Commit 7705553f by 田超

Merge branch 'feature/1003104' into 'master'

feat: [1003104] 小睿小程序独立管理端2期

See merge request rays/pcloud-book!922
parents 3520223e 72f1c22a
...@@ -40,4 +40,7 @@ public class AppletUserLabelDTO { ...@@ -40,4 +40,7 @@ public class AppletUserLabelDTO {
return appletUserLabel; return appletUserLabel;
} }
@ApiModelProperty("出版社id")
private Long agentId;
} }
\ No newline at end of file
...@@ -15,4 +15,5 @@ public class AppletUserLabel { ...@@ -15,4 +15,5 @@ public class AppletUserLabel {
private Date updateTime; private Date updateTime;
private Long agentId;
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@FeignClient(value = "pcloud-service-book", qualifier = "appletServiceCloud", path = "book/v1.0/appletService") @FeignClient(value = "pcloud-service-book", qualifier = "appletServiceCloud", path = "book/v1.0/appletService")
@Api(description = "小程序内部接口") @Api(description = "小程序内部接口")
...@@ -32,4 +33,8 @@ public interface AppletService { ...@@ -32,4 +33,8 @@ public interface AppletService {
@GetMapping("getOuterBookById") @GetMapping("getOuterBookById")
public ResponseEntity<ResponseDto<AppletOuterBookDTO>> getOuterBookById(@RequestParam("outerBookId") Long outerBookId); public ResponseEntity<ResponseDto<AppletOuterBookDTO>> getOuterBookById(@RequestParam("outerBookId") Long outerBookId);
@ApiOperation("给出版分配小睿基本书刊分类")
@GetMapping("createBaseClassifysToAgent")
void createBaseClassifysToAgent(@RequestParam("agentId") @ApiParam Long agentId);
} }
...@@ -41,5 +41,13 @@ public interface AppletBannerBiz { ...@@ -41,5 +41,13 @@ public interface AppletBannerBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<AppletBannerDTO> listBanner(Integer currentPage, Integer numPerPage, Boolean showState); PageBeanNew<AppletBannerDTO> listBanner(Integer currentPage, Integer numPerPage, Boolean showState, Long agentId);
/**
* 客户端banner列表
* @author:zhuyajie
* @date:2020/7/17 16:03
* * @param null
*/
PageBeanNew<AppletBannerDTO> listBanner4Wechat(Integer currentPage, Integer numPerPage, Boolean showState, Long officialAccountsId);
} }
...@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.AppletBookClassifyDTO; ...@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.AppletBookClassifyDTO;
import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO; import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO;
import com.pcloud.book.applet.dto.AppletUserLabelDTO; import com.pcloud.book.applet.dto.AppletUserLabelDTO;
import com.pcloud.book.applet.entity.AppletBookClassify; import com.pcloud.book.applet.entity.AppletBookClassify;
import com.pcloud.book.applet.entity.AppletBookClassifyAgent;
import com.pcloud.book.applet.entity.AppletUserLabelRelation; import com.pcloud.book.applet.entity.AppletUserLabelRelation;
import java.util.List; import java.util.List;
...@@ -75,18 +76,18 @@ public interface AppletBookClassifyBiz { ...@@ -75,18 +76,18 @@ public interface AppletBookClassifyBiz {
void deleteUserLabel(Long id); void deleteUserLabel(Long id);
/** /**
* 客户端标签列表 * 平台端设置的客户端标签列表
* @param appletBookClassifyId * @param appletBookClassifyId
* @return * @return
*/ */
List<AppletUserLabelDTO> listUserLabel(Long appletBookClassifyId); List<AppletUserLabelDTO> listUserLabel(Long appletBookClassifyId, Long agentId);
/** /**
* 获取书刊分类列表及其标签 * 获取书刊分类列表及其标签
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/18 16:14 * @date:2020/5/18 16:14
* * @param null * * @param null
*/ */
List<AppletBookClassifyDTO> getAllBookClassifyAndLabel(String grayStatus); List<AppletBookClassifyDTO> getAllBookClassifyAndLabel4Wechat(String grayStatus, Long officialAccountsId);
/** /**
* 查关联书刊分类 * 查关联书刊分类
...@@ -121,4 +122,43 @@ public interface AppletBookClassifyBiz { ...@@ -121,4 +122,43 @@ public interface AppletBookClassifyBiz {
Long getAppletBookClassifyId(Long firstClassifyId); Long getAppletBookClassifyId(Long firstClassifyId);
Map<Long, AppletBookClassifyDTO> getBookClassifyByIds(List<Long> bookAdviserIds); Map<Long, AppletBookClassifyDTO> getBookClassifyByIds(List<Long> bookAdviserIds);
/**
* 给出版分配小睿基本书刊分类
* @author:zhuyajie
* @date:2020/7/17 17:01
* * @param null
*/
void createBaseClassifysToAgent(Long agentId);
/**
* 出版社修改客户端分类展示状态、名称
* @author:zhuyajie
* @date:2020/7/17 17:10
* * @param null
*/
void updateBaseInfoByAgent(AppletBookClassifyAgent appletBookClassifyAgent);
/**
* 小睿出版管理端书刊分类查询
* @author:zhuyajie
* @date:2020/7/17 19:10
* * @param null
*/
List<AppletBookClassifyDTO> getAppletBookClassifyListByAgent(Long agentId, Boolean showState);
/**
* 客户端书刊分类查询
* @author:zhuyajie
* @date:2020/7/20 9:46
* * @param null
*/
List<AppletBookClassifyDTO> getAppletBookClassifyList4Wechat(Long officialAccountsId, Boolean showState);
/**
* 客户端标签列表
* @author:zhuyajie
* @date:2020/7/22 15:27
* * @param null
*/
List<AppletUserLabelDTO> listUserLabel4Wechat(Long appletBookClassifyId, Long officialAccountsId);
} }
...@@ -42,7 +42,7 @@ public interface AppletBooklistBiz { ...@@ -42,7 +42,7 @@ public interface AppletBooklistBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<AppletBooklistClassifyDTO> listBooklistClassify(Integer currentPage, Integer numPerPage, String name); PageBeanNew<AppletBooklistClassifyDTO> listBooklistClassify(Integer currentPage, Integer numPerPage, String name, Long agentId);
/** /**
* 新增书单 * 新增书单
...@@ -74,7 +74,7 @@ public interface AppletBooklistBiz { ...@@ -74,7 +74,7 @@ public interface AppletBooklistBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<AppletBooklistDTO> listBooklist(Integer currentPage, Integer numPerPage, String name, Long classifyId); PageBeanNew<AppletBooklistDTO> listBooklist(Integer currentPage, Integer numPerPage, String name, Long classifyId, Long agentId);
/** /**
* 书单添加图书 * 书单添加图书
...@@ -101,7 +101,7 @@ public interface AppletBooklistBiz { ...@@ -101,7 +101,7 @@ public interface AppletBooklistBiz {
* 获取所有书单栏目 * 获取所有书单栏目
* @return * @return
*/ */
List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState); List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState, Long agentId);
/** /**
* 客户端获取书单列表 * 客户端获取书单列表
...@@ -110,7 +110,7 @@ public interface AppletBooklistBiz { ...@@ -110,7 +110,7 @@ public interface AppletBooklistBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<AppletBooklistDTO> listBooklist4Wechat(Long classifyId, Integer currentPage, Integer numPerPage, Long wechatUserId); PageBeanNew<AppletBooklistDTO> listBooklist4Wechat(Long classifyId, Integer currentPage, Integer numPerPage, Long wechatUserId, Long officialAccountsId);
/** /**
* 客户端根据id获取书单 * 客户端根据id获取书单
...@@ -134,21 +134,29 @@ public interface AppletBooklistBiz { ...@@ -134,21 +134,29 @@ public interface AppletBooklistBiz {
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
void addUserBooklistClassify(List<Long> classifyIds, Long wechatUserId); void addUserBooklistClassify(List<Long> classifyIds, Long wechatUserId, Long officialAccountsId);
/** /**
* 所有书单栏目列表+用户选择的书单栏目 * 所有书单栏目列表+用户选择的书单栏目
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
List<AppletBooklistClassifyDTO> getAllBooklistClassify4Wechat(Long wechatUserId); List<AppletBooklistClassifyDTO> getAllBooklistClassify4Wechat(Long wechatUserId, Long officialAccountsId);
/** /**
* 用户选择的书单栏目 * 用户选择的书单栏目
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
List<AppletBooklistClassifyDTO> getBooklistClassifyByUser(Long wechatUserId); List<AppletBooklistClassifyDTO> getBooklistClassifyByUser(Long wechatUserId, Long officialAccountsId);
/**
* 添加默认书单推荐栏目
* @author:zhuyajie
* @date:2020/8/5 10:59
* * @param null
*/
void addDefaultBooklistClassify(Long agentId);
/** /**
* 添加外部书刊 * 添加外部书刊
* @author:zhuyajie * @author:zhuyajie
......
...@@ -24,7 +24,7 @@ public interface AppletGroupManageBiz { ...@@ -24,7 +24,7 @@ public interface AppletGroupManageBiz {
/** /**
* 分页查询 * 分页查询
*/ */
PageBeanNew getList(String name, Integer currentPage, Integer numPerPage); PageBeanNew getList(String name, Integer currentPage, Integer numPerPage, Long agentId);
/** /**
* 任意门 * 任意门
...@@ -35,7 +35,7 @@ public interface AppletGroupManageBiz { ...@@ -35,7 +35,7 @@ public interface AppletGroupManageBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew getList4Applet(Long wechatUserId, Integer recommend, Integer currentPage, Integer numPerPage); PageBeanNew getList4Applet(Long wechatUserId, Integer recommend, Integer currentPage, Integer numPerPage,Long officialAccountsId);
/** /**
* 新增数据 * 新增数据
...@@ -43,7 +43,7 @@ public interface AppletGroupManageBiz { ...@@ -43,7 +43,7 @@ public interface AppletGroupManageBiz {
* @param groupActivityIds * @param groupActivityIds
* @return 主键 * @return 主键
*/ */
void insert(List<Long> groupActivityIds); void insert(List<Long> groupActivityIds, Long agentId);
/** /**
* 修改数据 * 修改数据
......
...@@ -26,7 +26,7 @@ public interface AppletGroupSearchRecordBiz { ...@@ -26,7 +26,7 @@ public interface AppletGroupSearchRecordBiz {
/** /**
* 分页查询 * 分页查询
*/ */
PageBeanNew getList(Long wechatUserId, Integer isMore, Integer currentPage, Integer numPerPage); PageBeanNew getList(Long wechatUserId, Integer isMore, Integer currentPage, Integer numPerPage, Long agentId);
/** /**
* 新增数据 * 新增数据
...@@ -53,7 +53,7 @@ public interface AppletGroupSearchRecordBiz { ...@@ -53,7 +53,7 @@ public interface AppletGroupSearchRecordBiz {
void deleteByIds(List<Long> ids); void deleteByIds(List<Long> ids);
List<GroupActivity4AppletDTO> getTishBookSchoolList(Long wechatUserId, Long bookGroupId); List<GroupActivity4AppletDTO> getTishBookSchoolList(Long wechatUserId, Long bookGroupId, Long officialAccountsId);
/** /**
* 群对话随机组装 * 群对话随机组装
...@@ -84,6 +84,6 @@ public interface AppletGroupSearchRecordBiz { ...@@ -84,6 +84,6 @@ public interface AppletGroupSearchRecordBiz {
* @date:2020/6/8 14:45 * @date:2020/6/8 14:45
* * @param null * * @param null
*/ */
PageBeanNew<AppletGroupManageDTO> getGroupList4AppletHome(Long wechatUserId, Integer currentPage, Integer numPerPage); PageBeanNew<AppletGroupManageDTO> getGroupList4AppletHome(Long wechatUserId, Integer currentPage, Integer numPerPage, Long officialAccountsId);
} }
\ No newline at end of file
...@@ -54,7 +54,7 @@ public interface AppletNewsBiz { ...@@ -54,7 +54,7 @@ public interface AppletNewsBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<AppletNewsClassifyDTO> listNewsClassify(Integer currentPage, Integer numPerPage, String name); PageBeanNew<AppletNewsClassifyDTO> listNewsClassify(Integer currentPage, Integer numPerPage, String name, Long agentId);
/** /**
* 添加资讯 * 添加资讯
...@@ -86,13 +86,13 @@ public interface AppletNewsBiz { ...@@ -86,13 +86,13 @@ public interface AppletNewsBiz {
PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name, PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name,
Long firstClassify, Long secondClassify, Long gradeLabelId, Long firstClassify, Long secondClassify, Long gradeLabelId,
Long subjectLabelId, Long rightsClassifyId, String source, Integer showState, Long newsClassifyId, Long subjectLabelId, Long rightsClassifyId, String source, Integer showState, Long newsClassifyId,
Long customTagId, String cityCode); Long customTagId, String cityCode,Long agentId);
/** /**
* 获取所有资讯栏目 * 获取所有资讯栏目
* @return * @return
*/ */
List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState); List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState, Long agentId);
/** /**
* 客户端资讯列表 * 客户端资讯列表
...@@ -101,7 +101,7 @@ public interface AppletNewsBiz { ...@@ -101,7 +101,7 @@ public interface AppletNewsBiz {
* @param newsClassifyId * @param newsClassifyId
* @return * @return
*/ */
PageBeanNew<AppletNewsDTO> listAppletNews4Wechat(Integer currentPage, Integer numPerPage, Long newsClassifyId, Long wechatUserId); PageBeanNew<AppletNewsDTO> listAppletNews4Wechat(Integer currentPage, Integer numPerPage, Long newsClassifyId, Long wechatUserId, Long officialAccountsId);
/** /**
* 添加资讯评论 * 添加资讯评论
...@@ -139,7 +139,7 @@ public interface AppletNewsBiz { ...@@ -139,7 +139,7 @@ public interface AppletNewsBiz {
* @param rightsType * @param rightsType
* @return * @return
*/ */
List<AppletNewsDTO> getNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType); List<AppletNewsDTO> getNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType, Long agentId);
/** /**
* 批量修改分类 * 批量修改分类
...@@ -166,7 +166,7 @@ public interface AppletNewsBiz { ...@@ -166,7 +166,7 @@ public interface AppletNewsBiz {
* @date:2020/4/27 14:46 * @date:2020/4/27 14:46
* * @param null * * @param null
*/ */
List<String> getNewsSourceList(); List<String> getNewsSourceList(Long agentId);
/** /**
...@@ -182,28 +182,28 @@ public interface AppletNewsBiz { ...@@ -182,28 +182,28 @@ public interface AppletNewsBiz {
* @date:2020/5/11 17:39 * @date:2020/5/11 17:39
* * @param null * * @param null
*/ */
String getUrlNumberByUrl(String jumpUrl); String getUrlNumberByUrl(String jumpUrl, Long agentId);
/** /**
* 用户选择资讯栏目 * 用户选择资讯栏目
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
void addUserNewsClassify(List<Long> newsClassifyIds, Long wechatUserId); void addUserNewsClassify(List<Long> newsClassifyIds, Long wechatUserId, Long officialAccountsId);
/** /**
* 所有资讯栏目列表+用户选择的资讯栏目 * 所有资讯栏目列表+用户选择的资讯栏目
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
List<AppletNewsClassifyDTO> getAllNewsClassify4Wechat(Long wechatUserId); List<AppletNewsClassifyDTO> getAllNewsClassify4Wechat(Long wechatUserId, Long officialAccountsId);
/** /**
* 用户选择的资讯栏目 * 用户选择的资讯栏目
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/14 11:21 * @date:2020/5/14 11:21
* * @param null * * @param null
*/ */
List<AppletNewsClassifyDTO> getNewsClassifyByUser(Long wechatUserId); List<AppletNewsClassifyDTO> getNewsClassifyByUser(Long wechatUserId, Long officialAccountsId);
/** /**
* 资讯统计分析 * 资讯统计分析
...@@ -214,7 +214,7 @@ public interface AppletNewsBiz { ...@@ -214,7 +214,7 @@ public interface AppletNewsBiz {
PageBeanNew<AppletNewsDTO> listAppletNews4Analysis(Integer currentPage, Integer numPerPage, String name, PageBeanNew<AppletNewsDTO> listAppletNews4Analysis(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId, Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Integer linkOnly,Long rightsClassifyId, Long subjectLabelId,Integer linkOnly,Long rightsClassifyId,
String source,Integer browseQty,Integer clickQty); String source,Integer browseQty,Integer clickQty, Long agentId);
/** /**
* *
...@@ -237,7 +237,7 @@ public interface AppletNewsBiz { ...@@ -237,7 +237,7 @@ public interface AppletNewsBiz {
* @date:2020/6/9 17:52 * @date:2020/6/9 17:52
* * @param null * * @param null
*/ */
void batchUpdateCustomTagId(List<Long> ids, Long customTagId, String customTag); void batchUpdateCustomTagId(List<Long> ids, Long customTagId, String customTag, Long agentId);
/** /**
* 新增自定义标识 * 新增自定义标识
* @author:zhuyajie * @author:zhuyajie
...@@ -258,7 +258,7 @@ public interface AppletNewsBiz { ...@@ -258,7 +258,7 @@ public interface AppletNewsBiz {
* @date:2020/6/9 17:52 * @date:2020/6/9 17:52
* * @param null * * @param null
*/ */
List<AppletNewsCustomTagDTO> getCustomTagList(); List<AppletNewsCustomTagDTO> getCustomTagList(Long agentId);
/** /**
* 根据标识id查资讯id列表 * 根据标识id查资讯id列表
* @author:zhuyajie * @author:zhuyajie
...@@ -286,4 +286,20 @@ public interface AppletNewsBiz { ...@@ -286,4 +286,20 @@ public interface AppletNewsBiz {
void updateCardShowState(AppletNews appletNews); void updateCardShowState(AppletNews appletNews);
AppletNewsDTO getNewsById4Applet(Long newsId); AppletNewsDTO getNewsById4Applet(Long newsId);
/**
* 根据公众号id获取出版社id
* @author:zhuyajie
* @date:2020/7/20 15:38
* * @param null
*/
Long getAgentIdByAccountId(Long officialAccountsId);
/**
* 添加默认推荐资讯栏目
* @author:zhuyajie
* @date:2020/8/5 10:53
* * @param null
*/
void addDefaultAppletNewsClassify(Long agentId);
} }
package com.pcloud.book.applet.biz.impl; package com.pcloud.book.applet.biz.impl;
import com.pcloud.book.applet.biz.AppletBannerBiz; import com.pcloud.book.applet.biz.AppletBannerBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dao.AppletBannerDao; import com.pcloud.book.applet.dao.AppletBannerDao;
import com.pcloud.book.applet.dto.AppletBannerDTO; import com.pcloud.book.applet.dto.AppletBannerDTO;
import com.pcloud.book.applet.entity.AppletBanner; import com.pcloud.book.applet.entity.AppletBanner;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.wechat.entity.AccountSetting;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -22,11 +27,16 @@ public class AppletBannerBizImpl implements AppletBannerBiz { ...@@ -22,11 +27,16 @@ public class AppletBannerBizImpl implements AppletBannerBiz {
@Autowired @Autowired
private AppletBannerDao appletBannerDao; private AppletBannerDao appletBannerDao;
@Autowired
private AppletNewsBiz appletNewsBiz;
@Override @Override
public Long addBanner(AppletBanner appletBanner) { public Long addBanner(AppletBanner appletBanner) {
Integer seq = appletBannerDao.getMaxSeq(); if (null == appletBanner.getAgentId()){
appletBanner.setAgentId(0L);
}
Integer seq = appletBannerDao.getMaxSeq(appletBanner.getAgentId());
appletBanner.setSeq(seq+1); appletBanner.setSeq(seq+1);
appletBanner.setShowState(false); appletBanner.setShowState(false);
appletBannerDao.insert(appletBanner); appletBannerDao.insert(appletBanner);
...@@ -57,11 +67,18 @@ public class AppletBannerBizImpl implements AppletBannerBiz { ...@@ -57,11 +67,18 @@ public class AppletBannerBizImpl implements AppletBannerBiz {
} }
@Override @Override
public PageBeanNew<AppletBannerDTO> listBanner(Integer currentPage, Integer numPerPage, Boolean showState) { public PageBeanNew<AppletBannerDTO> listBanner(Integer currentPage, Integer numPerPage, Boolean showState, Long agentId) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("showState", showState); map.put("showState", showState);
map.put("agentId", agentId);
PageBeanNew<AppletBannerDTO> pageBeanNew = appletBannerDao.listPageNew( PageBeanNew<AppletBannerDTO> pageBeanNew = appletBannerDao.listPageNew(
new PageParam(currentPage,numPerPage), map, "listBanner"); new PageParam(currentPage,numPerPage), map, "listBanner");
return pageBeanNew; return pageBeanNew;
} }
@Override
public PageBeanNew<AppletBannerDTO> listBanner4Wechat(Integer currentPage, Integer numPerPage, Boolean showState, Long officialAccountsId) {
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
return listBanner(currentPage, numPerPage, showState, agentId);
}
} }
...@@ -2,12 +2,19 @@ package com.pcloud.book.applet.biz.impl; ...@@ -2,12 +2,19 @@ package com.pcloud.book.applet.biz.impl;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO; import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.biz.AppletBookClassifyBiz; import com.pcloud.book.applet.biz.AppletBookClassifyBiz;
import com.pcloud.book.applet.biz.AppletBooklistBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dao.AppletBookClassifyAgentDao;
import com.pcloud.book.applet.dao.AppletBookClassifyDao; import com.pcloud.book.applet.dao.AppletBookClassifyDao;
import com.pcloud.book.applet.dto.AppletBookClassifyDTO; import com.pcloud.book.applet.dto.AppletBookClassifyDTO;
import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO; import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO;
import com.pcloud.book.applet.dto.AppletBooklistClassifyDTO;
import com.pcloud.book.applet.dto.AppletLabelDTO; import com.pcloud.book.applet.dto.AppletLabelDTO;
import com.pcloud.book.applet.dto.AppletNewsClassifyDTO;
import com.pcloud.book.applet.dto.AppletUserLabelDTO; import com.pcloud.book.applet.dto.AppletUserLabelDTO;
import com.pcloud.book.applet.entity.AppletBookClassify; import com.pcloud.book.applet.entity.AppletBookClassify;
import com.pcloud.book.applet.entity.AppletBookClassifyAgent;
import com.pcloud.book.applet.entity.AppletNewsClassify;
import com.pcloud.book.applet.entity.AppletUserLabel; import com.pcloud.book.applet.entity.AppletUserLabel;
import com.pcloud.book.applet.entity.AppletUserLabelRelation; import com.pcloud.book.applet.entity.AppletUserLabelRelation;
import com.pcloud.book.applet.enums.LabelTypeEnum; import com.pcloud.book.applet.enums.LabelTypeEnum;
...@@ -17,7 +24,10 @@ import com.pcloud.book.base.exception.BookBizException; ...@@ -17,7 +24,10 @@ import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.dao.BookLabelDao; import com.pcloud.book.book.dao.BookLabelDao;
import com.pcloud.book.book.entity.BookLabel; import com.pcloud.book.book.entity.BookLabel;
import com.pcloud.book.consumer.app.AssistTempletConsr; import com.pcloud.book.consumer.app.AssistTempletConsr;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.util.common.YesOrNoEnums; import com.pcloud.book.util.common.YesOrNoEnums;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.wechat.entity.AccountSetting;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
...@@ -54,9 +64,14 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -54,9 +64,14 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
private AppletUserLabelRelationMapper relationMapper; private AppletUserLabelRelationMapper relationMapper;
@Autowired @Autowired
private AssistTempletConsr assistTempletConsr; private AssistTempletConsr assistTempletConsr;
@Autowired @Autowired
private BookLabelDao bookLabelDao; private BookLabelDao bookLabelDao;
@Autowired
private AppletBookClassifyAgentDao appletBookClassifyAgentDao;
@Autowired
private AppletNewsBiz appletNewsBiz;
@Autowired
private AppletBooklistBiz appletBooklistBiz;
@Override @Override
...@@ -86,6 +101,9 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -86,6 +101,9 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
@ParamLog("平台端新增客户端标签") @ParamLog("平台端新增客户端标签")
public void addUserLabel(AppletUserLabelDTO appletUserLabelDTO) { public void addUserLabel(AppletUserLabelDTO appletUserLabelDTO) {
AppletUserLabel appletUserLabel = appletUserLabelDTO.DTOToEntity(); AppletUserLabel appletUserLabel = appletUserLabelDTO.DTOToEntity();
if (null == appletUserLabel.getAgentId()){
appletUserLabel.setAgentId(0L);
}
appletUserLabelMapper.insert(appletUserLabel); appletUserLabelMapper.insert(appletUserLabel);
List<AppletUserLabelRelation> appletUserLabelRelations = appletUserLabelDTO.getAppletUserLabelRelations(); List<AppletUserLabelRelation> appletUserLabelRelations = appletUserLabelDTO.getAppletUserLabelRelations();
if (ListUtils.isEmpty(appletUserLabelRelations)){ if (ListUtils.isEmpty(appletUserLabelRelations)){
...@@ -155,9 +173,9 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -155,9 +173,9 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
} }
@Override @Override
@ParamLog("客户端标签列表") @ParamLog("平台端设置的客户端标签列表")
public List<AppletUserLabelDTO> listUserLabel(Long appletBookClassifyId) { public List<AppletUserLabelDTO> listUserLabel(Long appletBookClassifyId, Long agentId) {
List<AppletUserLabelDTO> appletUserLabelDTOS = appletUserLabelMapper.listUserLabel(appletBookClassifyId); List<AppletUserLabelDTO> appletUserLabelDTOS = appletUserLabelMapper.listUserLabel(appletBookClassifyId, agentId);
if (ListUtils.isEmpty(appletUserLabelDTOS)) { if (ListUtils.isEmpty(appletUserLabelDTOS)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -227,8 +245,8 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -227,8 +245,8 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
@Override @Override
public List<AppletBookClassifyDTO> getAllBookClassifyAndLabel(String grayStatus) { public List<AppletBookClassifyDTO> getAllBookClassifyAndLabel4Wechat(String grayStatus, Long officialAccountsId) {
List<AppletBookClassifyDTO> classifyAndLabelDTOS = appletBookClassifyDao.queryAll(true); List<AppletBookClassifyDTO> classifyAndLabelDTOS = getAppletBookClassifyList4Wechat(officialAccountsId, true);
if (ListUtils.isEmpty(classifyAndLabelDTOS)) { if (ListUtils.isEmpty(classifyAndLabelDTOS)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -240,7 +258,8 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -240,7 +258,8 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
} }
} }
} }
List<AppletLabelDTO> userLabelDTOS = appletUserLabelMapper.getBookClassifyAndLabel(); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
List<AppletLabelDTO> userLabelDTOS = appletUserLabelMapper.getBookClassifyAndLabel(agentId);
if (ListUtils.isEmpty(userLabelDTOS)) { if (ListUtils.isEmpty(userLabelDTOS)) {
return classifyAndLabelDTOS; return classifyAndLabelDTOS;
} }
...@@ -283,4 +302,67 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz { ...@@ -283,4 +302,67 @@ public class AppletBookClassifyBizImpl implements AppletBookClassifyBiz {
return appletBookClassifyDao.getBookClassifyByIds(bookAdviserIds); return appletBookClassifyDao.getBookClassifyByIds(bookAdviserIds);
} }
@Override
public void createBaseClassifysToAgent(Long agentId) {
//书刊分类
List<AppletBookClassifyDTO> list = appletBookClassifyDao.queryAll(null);
if (!ListUtils.isEmpty(list)) {
List<AppletBookClassifyAgent> agents = appletBookClassifyAgentDao.getByAgent(agentId);
if (ListUtils.isEmpty(agents)){
List<AppletBookClassifyAgent> bookClassifyAgents = new ArrayList<>();
for (AppletBookClassifyDTO classifyDTO : list) {
AppletBookClassifyAgent classifyAgent = new AppletBookClassifyAgent();
classifyAgent.setAppletBookClassifyId(classifyDTO.getId());
classifyAgent.setAgentId(agentId);
classifyAgent.setShowState(true);
classifyAgent.setClassifyName(classifyDTO.getClassify());
classifyAgent.setSeq(classifyDTO.getSeq());
classifyAgent.setPic(classifyDTO.getPic());
bookClassifyAgents.add(classifyAgent);
}
appletBookClassifyAgentDao.insert(bookClassifyAgents);
}
}
//资讯推荐栏目
List<AppletNewsClassifyDTO> newsClassify = appletNewsBiz.getAllNewsClassify(null, agentId);
if (ListUtils.isEmpty(newsClassify)){
appletNewsBiz.addDefaultAppletNewsClassify(agentId);
}
//书单推荐栏目
List<AppletBooklistClassifyDTO> booklistClassify = appletBooklistBiz.getAllBooklistClassify(null, agentId);
if (ListUtils.isEmpty(booklistClassify)){
appletBooklistBiz.addDefaultBooklistClassify(agentId);
}
}
@Override
public void updateBaseInfoByAgent(AppletBookClassifyAgent appletBookClassifyAgent) {
if (null == appletBookClassifyAgent || null == appletBookClassifyAgent.getAgentId()
|| null == appletBookClassifyAgent.getAppletBookClassifyId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数缺失");
}
appletBookClassifyAgentDao.updateBaseInfoByAgent(appletBookClassifyAgent);
}
@Override
public List<AppletBookClassifyDTO> getAppletBookClassifyListByAgent(Long agentId, Boolean showState) {
return appletBookClassifyAgentDao.listClassifyByAgent(agentId, showState);
}
@Override
public List<AppletBookClassifyDTO> getAppletBookClassifyList4Wechat(Long officialAccountsId, Boolean showState) {
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
if (null == agentId){
return getAppletBookClassifyList(showState);
}else {
return getAppletBookClassifyListByAgent(agentId, showState);
}
}
@Override
public List<AppletUserLabelDTO> listUserLabel4Wechat(Long appletBookClassifyId, Long officialAccountsId) {
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
return listUserLabel(appletBookClassifyId, agentId);
}
} }
...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl; ...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO; import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.biz.AppletBooklistBiz; import com.pcloud.book.applet.biz.AppletBooklistBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.contants.AppletConstants; import com.pcloud.book.applet.contants.AppletConstants;
import com.pcloud.book.applet.dao.AppletBooklistClassifyDao; import com.pcloud.book.applet.dao.AppletBooklistClassifyDao;
import com.pcloud.book.applet.dao.AppletBooklistDao; import com.pcloud.book.applet.dao.AppletBooklistDao;
...@@ -14,6 +15,7 @@ import com.pcloud.book.applet.dto.AppletOuterBookDTO; ...@@ -14,6 +15,7 @@ import com.pcloud.book.applet.dto.AppletOuterBookDTO;
import com.pcloud.book.applet.dto.AppletOuterBooklistDTO; import com.pcloud.book.applet.dto.AppletOuterBooklistDTO;
import com.pcloud.book.applet.dto.BookDTO4Booklist; import com.pcloud.book.applet.dto.BookDTO4Booklist;
import com.pcloud.book.applet.dto.OuterBooklistAddDTO; import com.pcloud.book.applet.dto.OuterBooklistAddDTO;
import com.pcloud.book.applet.entity.AppletBookClassify;
import com.pcloud.book.applet.entity.AppletBooklist; import com.pcloud.book.applet.entity.AppletBooklist;
import com.pcloud.book.applet.entity.AppletBooklistClassify; import com.pcloud.book.applet.entity.AppletBooklistClassify;
import com.pcloud.book.applet.entity.AppletBooklistClassifyUser; import com.pcloud.book.applet.entity.AppletBooklistClassifyUser;
...@@ -24,6 +26,9 @@ import com.pcloud.book.book.biz.BookBiz; ...@@ -24,6 +26,9 @@ import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dao.BookRaysClassifyDao; import com.pcloud.book.book.dao.BookRaysClassifyDao;
import com.pcloud.book.consumer.app.AssistTempletConsr; import com.pcloud.book.consumer.app.AssistTempletConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.wechat.entity.AccountSetting;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
...@@ -66,6 +71,8 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -66,6 +71,8 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
@Autowired @Autowired
private BookRaysClassifyDao bookRaysClassifyDao; private BookRaysClassifyDao bookRaysClassifyDao;
@Autowired @Autowired
private AppletNewsBiz appletNewsBiz;
@Autowired
private AppletOuterBookDao appletOuterBookDao; private AppletOuterBookDao appletOuterBookDao;
@Autowired @Autowired
private AppletOuterBooklistDao appletOuterBooklistDao; private AppletOuterBooklistDao appletOuterBooklistDao;
...@@ -73,7 +80,10 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -73,7 +80,10 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
@Override @Override
public Long addBooklistClassify(AppletBooklistClassify appletBooklistClassify) { public Long addBooklistClassify(AppletBooklistClassify appletBooklistClassify) {
Integer seq = appletBooklistClassifyDao.getMaxSeq(); if (null == appletBooklistClassify.getAgentId()){
appletBooklistClassify.setAgentId(0L);
}
Integer seq = appletBooklistClassifyDao.getMaxSeq(appletBooklistClassify.getAgentId());
appletBooklistClassify.setSeq(seq+1); appletBooklistClassify.setSeq(seq+1);
appletBooklistClassify.setShowState(false); appletBooklistClassify.setShowState(false);
appletBooklistClassifyDao.insert(appletBooklistClassify); appletBooklistClassifyDao.insert(appletBooklistClassify);
...@@ -99,11 +109,12 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -99,11 +109,12 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public PageBeanNew<AppletBooklistClassifyDTO> listBooklistClassify(Integer currentPage, Integer numPerPage, String name) { public PageBeanNew<AppletBooklistClassifyDTO> listBooklistClassify(Integer currentPage, Integer numPerPage, String name, Long agentId) {
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
paramMap.put("name", name); paramMap.put("name", name);
paramMap.put("agentId", agentId);
PageBeanNew<AppletBooklistClassifyDTO> pageBeanNew = appletBooklistClassifyDao.listPageNew( PageBeanNew<AppletBooklistClassifyDTO> pageBeanNew = appletBooklistClassifyDao.listPageNew(
new PageParam(currentPage,numPerPage) ,paramMap,"listBooklistClassify"); new PageParam(currentPage,numPerPage), paramMap,"listBooklistClassify");
return pageBeanNew; return pageBeanNew;
} }
...@@ -141,10 +152,11 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -141,10 +152,11 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public PageBeanNew<AppletBooklistDTO> listBooklist(Integer currentPage, Integer numPerPage, String name, Long classifyId) { public PageBeanNew<AppletBooklistDTO> listBooklist(Integer currentPage, Integer numPerPage, String name, Long classifyId, Long agentId) {
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
paramMap.put("name", name); paramMap.put("name", name);
paramMap.put("classifyId", classifyId); paramMap.put("classifyId", classifyId);
paramMap.put("agentId", agentId);
PageBeanNew<AppletBooklistDTO> pageBeanNew = appletBooklistDao.listPageNew( PageBeanNew<AppletBooklistDTO> pageBeanNew = appletBooklistDao.listPageNew(
new PageParam(currentPage,numPerPage), paramMap,"listBooklist"); new PageParam(currentPage,numPerPage), paramMap,"listBooklist");
if(null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())){ if(null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())){
...@@ -233,18 +245,19 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -233,18 +245,19 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState){ public List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState, Long agentId){
return appletBooklistClassifyDao.getAllBooklistClassify(showState); return appletBooklistClassifyDao.getAllBooklistClassify(showState, agentId);
} }
@Override @Override
public PageBeanNew<AppletBooklistDTO> listBooklist4Wechat(Long classifyId, Integer currentPage, Integer numPerPage, Long wechatUserId) { public PageBeanNew<AppletBooklistDTO> listBooklist4Wechat(Long classifyId, Integer currentPage, Integer numPerPage, Long wechatUserId, Long officialAccountsId) {
PageBeanNew<AppletBooklistDTO> pageBeanNew = new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); PageBeanNew<AppletBooklistDTO> pageBeanNew = new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (null == classifyId) {//首页书单推荐 if (null == classifyId) {//首页书单推荐
List<Long> classifyIds = appletBooklistClassifyDao.getClassifyIdsByUserId(wechatUserId); List<Long> classifyIds = appletBooklistClassifyDao.getClassifyIdsByUserId(wechatUserId);
if (ListUtils.isEmpty(classifyIds)) {//没有栏目id取第一个 if (ListUtils.isEmpty(classifyIds)) {//没有栏目id取第一个
List<AppletBooklistClassifyDTO> classifyDTOS = getAllBooklistClassify(true); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
List<AppletBooklistClassifyDTO> classifyDTOS = getAllBooklistClassify(true, agentId);
if (ListUtils.isEmpty(classifyDTOS)) { if (ListUtils.isEmpty(classifyDTOS)) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
...@@ -311,13 +324,14 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -311,13 +324,14 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public void addUserBooklistClassify(List<Long> classifyIds, Long wechatUserId) { public void addUserBooklistClassify(List<Long> classifyIds, Long wechatUserId, Long officialAccountsId) {
if (null == wechatUserId){ if (null == wechatUserId){
return; return;
} }
appletBooklistClassifyDao.deleteClassifyByWechatUesrId(wechatUserId); appletBooklistClassifyDao.deleteClassifyByWechatUesrId(wechatUserId);
if (ListUtils.isEmpty(classifyIds)){ if (ListUtils.isEmpty(classifyIds)){
List<AppletBooklistClassifyDTO> classifyDTOS = getAllBooklistClassify(true); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
List<AppletBooklistClassifyDTO> classifyDTOS = getAllBooklistClassify(true, agentId);
if (ListUtils.isEmpty(classifyDTOS)){ if (ListUtils.isEmpty(classifyDTOS)){
return; return;
} }
...@@ -334,8 +348,9 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -334,8 +348,9 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public List<AppletBooklistClassifyDTO> getAllBooklistClassify4Wechat(Long wechatUserId) { public List<AppletBooklistClassifyDTO> getAllBooklistClassify4Wechat(Long wechatUserId, Long officialAccountsId) {
List<AppletBooklistClassifyDTO> list = appletBooklistClassifyDao.getAllBooklistClassify(true); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
List<AppletBooklistClassifyDTO> list = appletBooklistClassifyDao.getAllBooklistClassify(true, agentId);
if (ListUtils.isEmpty(list)) { if (ListUtils.isEmpty(list)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -354,10 +369,11 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -354,10 +369,11 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
} }
@Override @Override
public List<AppletBooklistClassifyDTO> getBooklistClassifyByUser(Long wechatUserId) { public List<AppletBooklistClassifyDTO> getBooklistClassifyByUser(Long wechatUserId, Long officialAccountsId) {
List<AppletBooklistClassifyDTO> list = appletBooklistClassifyDao.getClassifysByUserId(wechatUserId); List<AppletBooklistClassifyDTO> list = appletBooklistClassifyDao.getClassifysByUserId(wechatUserId);
if (ListUtils.isEmpty(list)){ if (ListUtils.isEmpty(list)){
List<AppletBooklistClassifyDTO> allBooklistClassify = appletBooklistClassifyDao.getAllBooklistClassify(true); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
List<AppletBooklistClassifyDTO> allBooklistClassify = appletBooklistClassifyDao.getAllBooklistClassify(true, agentId);
if (ListUtils.isEmpty(allBooklistClassify)){ if (ListUtils.isEmpty(allBooklistClassify)){
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -553,4 +569,17 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz { ...@@ -553,4 +569,17 @@ public class AppletBooklistBizImpl implements AppletBooklistBiz {
PageBeanNew<AppletOuterBookDTO> pageBeanNew = appletOuterBookDao.listPageNew(new PageParam(currentPage,numPerPage), map,"listPageOuterBookByBooklistId"); PageBeanNew<AppletOuterBookDTO> pageBeanNew = appletOuterBookDao.listPageNew(new PageParam(currentPage,numPerPage), map,"listPageOuterBookByBooklistId");
return pageBeanNew; return pageBeanNew;
} }
@Override
public void addDefaultBooklistClassify(Long agentId) {
AppletBooklistClassify appletBooklistClassify = new AppletBooklistClassify();
appletBooklistClassify.setSeq(0);
appletBooklistClassify.setAgentId(agentId);
appletBooklistClassify.setClassifyName("推荐");
appletBooklistClassify.setPic("https://file.5rs.me/oss/uploadfe/png/30ac33d2ecd19649fd86250065a58e42.png");
appletBooklistClassify.setShowState(false);
appletBooklistClassifyDao.insert(appletBooklistClassify);
}
} }
...@@ -3,11 +3,13 @@ package com.pcloud.book.applet.biz.impl; ...@@ -3,11 +3,13 @@ package com.pcloud.book.applet.biz.impl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.pcloud.book.applet.biz.AppletGroupManageBiz; import com.pcloud.book.applet.biz.AppletGroupManageBiz;
import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz; import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dao.AppletGroupManageDao; import com.pcloud.book.applet.dao.AppletGroupManageDao;
import com.pcloud.book.applet.dto.AppletGroupManageDTO; import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.applet.dto.AppletGroupStatementDTO; import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO; import com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO;
import com.pcloud.book.applet.entity.AppletGroupManage; import com.pcloud.book.applet.entity.AppletGroupManage;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.label.LabelConsr; import com.pcloud.book.consumer.label.LabelConsr;
import com.pcloud.book.consumer.reader.ReaderConsr; import com.pcloud.book.consumer.reader.ReaderConsr;
import com.pcloud.book.group.biz.GroupQrcodeBiz; import com.pcloud.book.group.biz.GroupQrcodeBiz;
...@@ -60,6 +62,8 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -60,6 +62,8 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
private BookQrcodeUserDao bookQrcodeUserDao; private BookQrcodeUserDao bookQrcodeUserDao;
@Autowired @Autowired
private BookClassifyBuyRecordDao bookClassifyBuyRecordDao; private BookClassifyBuyRecordDao bookClassifyBuyRecordDao;
@Autowired
private AppletNewsBiz appletNewsBiz;
@Override @Override
public AppletGroupManage getById(Long id) { public AppletGroupManage getById(Long id) {
...@@ -67,9 +71,10 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -67,9 +71,10 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
} }
@Override @Override
public PageBeanNew getList(String name, Integer currentPage, Integer numPerPage) { public PageBeanNew getList(String name, Integer currentPage, Integer numPerPage, Long agentId) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("name", name); map.put("name", name);
map.put("agentId", agentId);
PageBeanNew<AppletGroupManageDTO> recordList = appletGroupManageDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList"); PageBeanNew<AppletGroupManageDTO> recordList = appletGroupManageDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList");
if (null == recordList || CollectionUtils.isEmpty(recordList.getRecordList())) { if (null == recordList || CollectionUtils.isEmpty(recordList.getRecordList())) {
return recordList; return recordList;
...@@ -111,9 +116,11 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -111,9 +116,11 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
} }
@Override @Override
public PageBeanNew getList4Applet(Long wechatUserId, Integer recommend, Integer currentPage, Integer numPerPage) { public PageBeanNew getList4Applet(Long wechatUserId, Integer recommend, Integer currentPage, Integer numPerPage, Long officialAccountsId) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("recommend", recommend); map.put("recommend", recommend);
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
map.put("agentId", agentId);
PageBeanNew<AppletGroupManageDTO> recordList = appletGroupManageDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList4Applet"); PageBeanNew<AppletGroupManageDTO> recordList = appletGroupManageDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList4Applet");
if (null == recordList || CollectionUtils.isEmpty(recordList.getRecordList())) { if (null == recordList || CollectionUtils.isEmpty(recordList.getRecordList())) {
return recordList; return recordList;
...@@ -158,10 +165,13 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -158,10 +165,13 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void insert(List<Long> groupActivityIds) { public void insert(List<Long> groupActivityIds, Long agentId) {
if (null == agentId){
agentId = 0L;
}
if(!ListUtils.isEmpty(groupActivityIds)){ if(!ListUtils.isEmpty(groupActivityIds)){
List<AppletGroupManage> list = Lists.newArrayList(); List<AppletGroupManage> list = Lists.newArrayList();
Integer maxSeqNum = appletGroupManageDao.getMaxSeqNum(); Integer maxSeqNum = appletGroupManageDao.getMaxSeqNum(agentId);
AppletGroupManage appletGroupManage; AppletGroupManage appletGroupManage;
for (Long groupActivityId : groupActivityIds) { for (Long groupActivityId : groupActivityIds) {
appletGroupManage = new AppletGroupManage(); appletGroupManage = new AppletGroupManage();
...@@ -169,12 +179,13 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -169,12 +179,13 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
appletGroupManage.setRecommend(0); appletGroupManage.setRecommend(0);
appletGroupManage.setEnable(1); appletGroupManage.setEnable(1);
appletGroupManage.setSeqNum((maxSeqNum + groupActivityIds.indexOf(groupActivityId) + 1)); appletGroupManage.setSeqNum((maxSeqNum + groupActivityIds.indexOf(groupActivityId) + 1));
appletGroupManage.setAgentId(agentId);
list.add(appletGroupManage); list.add(appletGroupManage);
} }
try { try {
appletGroupManageDao.insert(list); appletGroupManageDao.insert(list);
} catch (DuplicateKeyException e){ } catch (DuplicateKeyException e){
throw new BizException("请勿添加重复数据"); throw new BookBizException(BookBizException.ERROR,"请勿添加重复数据");
} }
} }
} }
...@@ -182,7 +193,7 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -182,7 +193,7 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
@Override @Override
public void update(UpdateAppletGroupManageDTO updateAppletGroupManageDTO) { public void update(UpdateAppletGroupManageDTO updateAppletGroupManageDTO) {
if(updateAppletGroupManageDTO == null || !NumberUtil.isNumber(updateAppletGroupManageDTO.getId())){ if(updateAppletGroupManageDTO == null || !NumberUtil.isNumber(updateAppletGroupManageDTO.getId())){
throw BizException.PARAM_IS_NULL; throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
} }
AppletGroupManage appletGroupManage = new AppletGroupManage(); AppletGroupManage appletGroupManage = new AppletGroupManage();
BeanUtils.copyProperties(updateAppletGroupManageDTO, appletGroupManage); BeanUtils.copyProperties(updateAppletGroupManageDTO, appletGroupManage);
......
...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl; ...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz.impl;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz; import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.biz.AppletUserBookcaseBiz; import com.pcloud.book.applet.biz.AppletUserBookcaseBiz;
import com.pcloud.book.applet.contants.AppletConstants; import com.pcloud.book.applet.contants.AppletConstants;
import com.pcloud.book.applet.dao.AppletGroupSearchRecordDao; import com.pcloud.book.applet.dao.AppletGroupSearchRecordDao;
...@@ -99,6 +100,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -99,6 +100,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
private BookClassifyBuyRecordDao bookClassifyBuyRecordDao; private BookClassifyBuyRecordDao bookClassifyBuyRecordDao;
@Autowired @Autowired
private GroupQrcodeBiz groupQrcodeBiz; private GroupQrcodeBiz groupQrcodeBiz;
@Autowired
private AppletNewsBiz appletNewsBiz;
@Override @Override
@ParamLog("通过ID查询单条数据") @ParamLog("通过ID查询单条数据")
...@@ -108,9 +111,10 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -108,9 +111,10 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override @Override
@ParamLog("查询多条数据") @ParamLog("查询多条数据")
public PageBeanNew getList(Long wechatUserId, Integer isMore, Integer currentPage, Integer numPerPage) { public PageBeanNew getList(Long wechatUserId, Integer isMore, Integer currentPage, Integer numPerPage, Long agentId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("wechatUserId", wechatUserId); map.put("wechatUserId", wechatUserId);
map.put("agentId", agentId);
PageBeanNew pageBeanNew = appletGroupSearchRecordDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList"); PageBeanNew pageBeanNew = appletGroupSearchRecordDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getList");
List<AppletGroupSearchRecordDTO> recordList = pageBeanNew.getRecordList(); List<AppletGroupSearchRecordDTO> recordList = pageBeanNew.getRecordList();
if (ListUtils.isEmpty(recordList)) { if (ListUtils.isEmpty(recordList)) {
...@@ -192,7 +196,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -192,7 +196,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
} }
@Override @Override
public List<GroupActivity4AppletDTO> getTishBookSchoolList(Long wechatUserId, Long bookGroupId) { public List<GroupActivity4AppletDTO> getTishBookSchoolList(Long wechatUserId, Long bookGroupId, Long officialAccountsId) {
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookGroupId); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookGroupId);
List<GroupActivity4AppletDTO> tishBookSchoolList = new ArrayList<>(); List<GroupActivity4AppletDTO> tishBookSchoolList = new ArrayList<>();
//本书自带社群 //本书自带社群
...@@ -240,11 +244,13 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -240,11 +244,13 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
baseTempletClassify.setSubjectLabelId(bookAdviser.getSubLabelId()); baseTempletClassify.setSubjectLabelId(bookAdviser.getSubLabelId());
// 部分分类需要忽略二级分类 // 部分分类需要忽略二级分类
rightsSettingBiz.setClassifyAndLabel(baseTempletClassify); rightsSettingBiz.setClassifyAndLabel(baseTempletClassify);
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
Map<String, Object> paraMap = Maps.newHashMap(); Map<String, Object> paraMap = Maps.newHashMap();
paraMap.put("firstClassify", baseTempletClassify.getFirstClassify()); paraMap.put("firstClassify", baseTempletClassify.getFirstClassify());
paraMap.put("secondClassify", baseTempletClassify.getSecondClassify()); paraMap.put("secondClassify", baseTempletClassify.getSecondClassify());
paraMap.put("gradeLabelId", baseTempletClassify.getGradeLabelId()); paraMap.put("gradeLabelId", baseTempletClassify.getGradeLabelId());
paraMap.put("subjectLabelId", baseTempletClassify.getSubjectLabelId()); paraMap.put("subjectLabelId", baseTempletClassify.getSubjectLabelId());
paraMap.put("agentId", agentId);
List<Long> classifyIds = pcloudGroupActivityDao.getGroupClassifyIds(paraMap); List<Long> classifyIds = pcloudGroupActivityDao.getGroupClassifyIds(paraMap);
List<Long> collect = tishBookSchoolList.stream().map(GroupActivity4AppletDTO::getClassifyId).distinct().collect(Collectors.toList()); List<Long> collect = tishBookSchoolList.stream().map(GroupActivity4AppletDTO::getClassifyId).distinct().collect(Collectors.toList());
classifyIds.removeAll(collect); classifyIds.removeAll(collect);
...@@ -333,7 +339,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -333,7 +339,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
} }
@Override @Override
public PageBeanNew<AppletGroupManageDTO> getGroupList4AppletHome(Long wechatUserId, Integer currentPage, Integer numPerPage) { public PageBeanNew<AppletGroupManageDTO> getGroupList4AppletHome(Long wechatUserId, Integer currentPage, Integer numPerPage, Long officialAccountsId) {
//用户最近读的书 //用户最近读的书
PageBeanNew<AppletUserBookcaseDTO> bookcaseDTOPageBeanNew = appletUserBookcaseBiz.listByWechatUserId(wechatUserId, currentPage, 1); PageBeanNew<AppletUserBookcaseDTO> bookcaseDTOPageBeanNew = appletUserBookcaseBiz.listByWechatUserId(wechatUserId, currentPage, 1);
if (null == bookcaseDTOPageBeanNew || ListUtils.isEmpty(bookcaseDTOPageBeanNew.getRecordList())) { if (null == bookcaseDTOPageBeanNew || ListUtils.isEmpty(bookcaseDTOPageBeanNew.getRecordList())) {
...@@ -343,7 +349,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi ...@@ -343,7 +349,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
if (null == bookcaseDTO) { if (null == bookcaseDTO) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
PageBeanNew<AppletGroupManageDTO> pageBeanNew = pcloudGroupActivityBiz.getGroupListByBookTemplet(wechatUserId, bookcaseDTO.getTempletId(), bookcaseDTO.getSecondTempletId(), bookcaseDTO.getGradeLabelId(), bookcaseDTO.getSubjectLabelId(), currentPage, numPerPage); Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
PageBeanNew<AppletGroupManageDTO> pageBeanNew = pcloudGroupActivityBiz.getGroupListByBookTemplet(wechatUserId, bookcaseDTO.getTempletId(), bookcaseDTO.getSecondTempletId(), bookcaseDTO.getGradeLabelId(), bookcaseDTO.getSubjectLabelId(), currentPage, numPerPage, agentId);
return pageBeanNew; return pageBeanNew;
} }
......
...@@ -9,5 +9,5 @@ public interface AppletBannerDao extends BaseDao<AppletBanner> { ...@@ -9,5 +9,5 @@ public interface AppletBannerDao extends BaseDao<AppletBanner> {
* 获取最大排序值 * 获取最大排序值
* @return * @return
*/ */
Integer getMaxSeq(); Integer getMaxSeq(Long agentId);
} }
package com.pcloud.book.applet.dao;
import com.pcloud.book.applet.dto.AppletBookClassifyDTO;
import com.pcloud.book.applet.entity.AppletBookClassifyAgent;
import com.pcloud.common.core.dao.BaseDao;
import com.pcloud.common.entity.BaseEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 出版社小程序分类菜单权限(AppletBookClassifyAgent)表数据库访问层
*
* @author makejava
* @since 2020-07-17 16:49:50
*/
public interface AppletBookClassifyAgentDao extends BaseDao<AppletBookClassifyAgent>{
void updateBaseInfoByAgent(AppletBookClassifyAgent appletBookClassifyAgent);
List<AppletBookClassifyAgent> getByAgent(Long agentId);
List<AppletBookClassifyDTO> listClassifyByAgent(Long agentId, Boolean showState);
}
\ No newline at end of file
...@@ -13,12 +13,12 @@ public interface AppletBooklistClassifyDao extends BaseDao<AppletBooklistClassif ...@@ -13,12 +13,12 @@ public interface AppletBooklistClassifyDao extends BaseDao<AppletBooklistClassif
* 获取最大排序值 * 获取最大排序值
* @return * @return
*/ */
Integer getMaxSeq(); Integer getMaxSeq(Long agentId);
/** /**
* 获取所有书单栏目 * 获取所有书单栏目
* @return * @return
*/ */
List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState); List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState, Long agentId);
/** /**
* 用户选择书单栏目 * 用户选择书单栏目
......
...@@ -12,5 +12,5 @@ import java.util.List; ...@@ -12,5 +12,5 @@ import java.util.List;
*/ */
public interface AppletGroupManageDao extends BaseDao<AppletGroupManage> { public interface AppletGroupManageDao extends BaseDao<AppletGroupManage> {
Integer getMaxSeqNum(); Integer getMaxSeqNum(Long agentId);
} }
\ No newline at end of file
...@@ -13,13 +13,13 @@ public interface AppletNewsClassifyDao extends BaseDao<AppletNewsClassify> { ...@@ -13,13 +13,13 @@ public interface AppletNewsClassifyDao extends BaseDao<AppletNewsClassify> {
* 获取最大排序值 * 获取最大排序值
* @return * @return
*/ */
Integer getMaxSeq(); Integer getMaxSeq(Long agentId);
/** /**
* 获取所有书单栏目 * 获取所有书单栏目
* @return * @return
*/ */
List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState); List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState, Long agentId);
/** /**
* 用户选择资讯栏目 * 用户选择资讯栏目
* @author:zhuyajie * @author:zhuyajie
......
...@@ -47,30 +47,31 @@ public interface AppletNewsDao extends BaseDao<AppletNews> { ...@@ -47,30 +47,31 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* @param rightsType * @param rightsType
* @return * @return
*/ */
List<AppletNewsDTO> getByNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType); List<AppletNewsDTO> getByNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType, Long agentId);
List<AppletNews> getByTempletAndClassify(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Long rightsClassifyId, Integer top); List<AppletNews> getByTempletAndClassify(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Long rightsClassifyId, Integer top,
Long agentId);
/** /**
*新增资讯来源 *新增资讯来源
*/ */
int insertSource(String source); void insertSource(String source, Long agentId);
/** /**
*资讯来源列表 *资讯来源列表
*/ */
List<String> getNewsSourceList(); List<String> getNewsSourceList(Long agentId);
/** /**
*资讯来源数量 *资讯来源数量
*/ */
Integer getAppletNewsSourceCount(String source); Integer getAppletNewsSourceCount(String source, Long agentId);
/** /**
*删除资讯来源 *删除资讯来源
*/ */
void deleteSource(String source); void deleteSource(String source, Long agentId);
/** /**
*来源是否存在 *来源是否存在
*/ */
Boolean newsSourceExist(String source); Boolean newsSourceExist(String source, Long agentId);
void batchUpdateClassify(AppletNewsClassifyVO appletNewsClassifyVO); void batchUpdateClassify(AppletNewsClassifyVO appletNewsClassifyVO);
...@@ -84,14 +85,14 @@ public interface AppletNewsDao extends BaseDao<AppletNews> { ...@@ -84,14 +85,14 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* @date:2020/5/11 17:39 * @date:2020/5/11 17:39
* * @param null * * @param null
*/ */
String getUrlNumberByJumpUrl(String jumpUrl); String getUrlNumberByJumpUrl(String jumpUrl, Long agentId);
/** /**
* 链接编号是否存在 * 链接编号是否存在
* @author:zhuyajie * @author:zhuyajie
* @date:2020/5/11 18:43 * @date:2020/5/11 18:43
* * @param null * * @param null
*/ */
Boolean urlNumberExist(String urlNumber, Long id); Boolean urlNumberExist(String urlNumber, Long id, Long agentId);
Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsIds); Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsIds);
...@@ -130,14 +131,14 @@ public interface AppletNewsDao extends BaseDao<AppletNews> { ...@@ -130,14 +131,14 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* @date:2020/6/9 17:52 * @date:2020/6/9 17:52
* * @param null * * @param null
*/ */
List<AppletNewsCustomTagDTO> getCustomTagList(); List<AppletNewsCustomTagDTO> getCustomTagList(Long agentId);
/** /**
* 标识是否存在 * 标识是否存在
* @author:zhuyajie * @author:zhuyajie
* @date:2020/6/9 18:12 * @date:2020/6/9 18:12
* * @param null * * @param null
*/ */
Boolean customTagExist(String customTag); Boolean customTagExist(String customTag, Long agentId);
/** /**
* 根据标识id查资讯id列表 * 根据标识id查资讯id列表
* @author:zhuyajie * @author:zhuyajie
......
...@@ -5,11 +5,16 @@ import com.pcloud.book.applet.entity.AppletBanner; ...@@ -5,11 +5,16 @@ import com.pcloud.book.applet.entity.AppletBanner;
import com.pcloud.common.core.dao.BaseDaoImpl; import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@Component @Component
public class AppletBannerDaoImpl extends BaseDaoImpl<AppletBanner> implements AppletBannerDao { public class AppletBannerDaoImpl extends BaseDaoImpl<AppletBanner> implements AppletBannerDao {
@Override @Override
public Integer getMaxSeq() { public Integer getMaxSeq(Long agentId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq")); Map<String, Object>map = new HashMap<>();
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("getMaxSeq"), map);
} }
} }
package com.pcloud.book.applet.dao.impl;
import com.pcloud.book.applet.dao.AppletBookClassifyAgentDao;
import com.pcloud.book.applet.dto.AppletBookClassifyDTO;
import com.pcloud.book.applet.entity.AppletBookClassifyAgent;
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.applet.dao.impl.AppletBookClassifyAgentDaoImpl
* @Author zhuyajie
* @Description
* @Date 2020/7/17 16:51
* @Version 1.0
**/
@Component
public class AppletBookClassifyAgentDaoImpl extends BaseDaoImpl<AppletBookClassifyAgent> implements AppletBookClassifyAgentDao {
@Override
public void updateBaseInfoByAgent(AppletBookClassifyAgent appletBookClassifyAgent) {
getSessionTemplate().update(getStatement("updateBaseInfoByAgent"), appletBookClassifyAgent);
}
@Override
public List<AppletBookClassifyAgent> getByAgent(Long agentId) {
return getSessionTemplate().selectList(getStatement("getByAgent"), agentId);
}
@Override
public List<AppletBookClassifyDTO> listClassifyByAgent(Long agentId, Boolean showState) {
Map<String,Object> map = new HashMap<>();
map.put("agentId", agentId);
map.put("showState", showState);
return getSessionTemplate().selectList(getStatement("listClassifyByAgent"), map);
}
}
...@@ -17,14 +17,17 @@ import java.util.Map; ...@@ -17,14 +17,17 @@ import java.util.Map;
public class AppletBooklistClassifyDaoImpl extends BaseDaoImpl<AppletBooklistClassify> implements AppletBooklistClassifyDao { public class AppletBooklistClassifyDaoImpl extends BaseDaoImpl<AppletBooklistClassify> implements AppletBooklistClassifyDao {
@Override @Override
public Integer getMaxSeq() { public Integer getMaxSeq(Long agentId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq")); Map<String,Object> map = new HashMap<>();
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("getMaxSeq"), map);
} }
@Override @Override
public List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState) { public List<AppletBooklistClassifyDTO> getAllBooklistClassify(Boolean showState, Long agentId) {
Map<String,Object>map=new HashMap<>(); Map<String,Object>map=new HashMap<>();
map.put("showState", showState); map.put("showState", showState);
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getAllBooklistClassify"), map); return getSessionTemplate().selectList(getStatement("getAllBooklistClassify"), map);
} }
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
public class AppletGroupManageDaoImpl extends BaseDaoImpl<AppletGroupManage> implements AppletGroupManageDao { public class AppletGroupManageDaoImpl extends BaseDaoImpl<AppletGroupManage> implements AppletGroupManageDao {
@Override @Override
public Integer getMaxSeqNum() { public Integer getMaxSeqNum(Long agentId) {
return super.sqlSessionTemplate.selectOne(getStatement("getMaxSeqNum")); return super.sqlSessionTemplate.selectOne(getStatement("getMaxSeqNum"), agentId);
} }
} }
\ No newline at end of file
...@@ -15,14 +15,17 @@ import java.util.Map; ...@@ -15,14 +15,17 @@ import java.util.Map;
@Component @Component
public class AppletNewsClassifyDaoImpl extends BaseDaoImpl<AppletNewsClassify> implements AppletNewsClassifyDao { public class AppletNewsClassifyDaoImpl extends BaseDaoImpl<AppletNewsClassify> implements AppletNewsClassifyDao {
@Override @Override
public Integer getMaxSeq() { public Integer getMaxSeq(Long agentId) {
return getSessionTemplate().selectOne(getStatement("getMaxSeq")); Map<String,Object> map=new HashMap<>();
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("getMaxSeq"), map);
} }
@Override @Override
public List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState) { public List<AppletNewsClassifyDTO> getAllNewsClassify(Boolean showState, Long agentId) {
Map<String,Object> map=new HashMap<>(); Map<String,Object> map=new HashMap<>();
map.put("showState", showState); map.put("showState", showState);
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getAllNewsClassify"), map); return getSessionTemplate().selectList(getStatement("getAllNewsClassify"), map);
} }
......
...@@ -40,19 +40,24 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet ...@@ -40,19 +40,24 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
} }
@Override @Override
public List<AppletNewsDTO> getByNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType) { public List<AppletNewsDTO> getByNewsByTempletLabel(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, String rightsType, Long agentId) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("firstClassify", firstClassify); map.put("firstClassify", firstClassify);
map.put("secondClassify", secondClassify); map.put("secondClassify", secondClassify);
map.put("gradeLabelId",gradeLabelId); map.put("gradeLabelId",gradeLabelId);
map.put("subjectLabelId", subjectLabelId); map.put("subjectLabelId", subjectLabelId);
map.put("rightsType",rightsType); map.put("rightsType",rightsType);
if (null == agentId){
agentId = 0L;
}
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getByNewsByTempletLabel"),map); return getSessionTemplate().selectList(getStatement("getByNewsByTempletLabel"),map);
} }
@Override @Override
public List<AppletNews> getByTempletAndClassify(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Long rightsClassifyId, Integer top) { public List<AppletNews> getByTempletAndClassify(Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Long rightsClassifyId, Integer top,
Long agentId) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("firstClassify", firstClassify); map.put("firstClassify", firstClassify);
map.put("secondClassify", secondClassify); map.put("secondClassify", secondClassify);
...@@ -60,32 +65,56 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet ...@@ -60,32 +65,56 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
map.put("subjectLabelId", subjectLabelId); map.put("subjectLabelId", subjectLabelId);
map.put("rightsClassifyId",rightsClassifyId); map.put("rightsClassifyId",rightsClassifyId);
map.put("top", top); map.put("top", top);
if (null == agentId){
agentId = 0L;
}
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getByTempletAndClassify"),map); return getSessionTemplate().selectList(getStatement("getByTempletAndClassify"),map);
} }
@Override @Override
public int insertSource(String source) { public void insertSource(String source, Long agentId) {
return getSessionTemplate().insert(getStatement("insertSource"),source); if (null == agentId) {
agentId = 0L;
}
Map<String, Object> map = new HashMap<>();
map.put("agentId", agentId);
map.put("source", source);
getSessionTemplate().insert(getStatement("insertSource"), map);
} }
@Override @Override
public List<String> getNewsSourceList() { public List<String> getNewsSourceList(Long agentId) {
return getSessionTemplate().selectList(getStatement("getNewsSourceList")); Map<String,Object>map = new HashMap<>();
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getNewsSourceList"), map);
} }
@Override @Override
public Integer getAppletNewsSourceCount(String source) { public Integer getAppletNewsSourceCount(String source, Long agentId) {
return getSessionTemplate().selectOne(getStatement("getAppletNewsSourceCount"),source); Map<String,Object>map = new HashMap<>();
map.put("agentId", agentId);
map.put("source", source);
return getSessionTemplate().selectOne(getStatement("getAppletNewsSourceCount"), map);
} }
@Override @Override
public void deleteSource(String source) { public void deleteSource(String source, Long agentId) {
getSessionTemplate().delete(getStatement("deleteSource"),source); if (null == agentId){
agentId = 0L;
}
Map<String,Object>map = new HashMap<>();
map.put("agentId", agentId);
map.put("source", source);
getSessionTemplate().delete(getStatement("deleteSource"), map);
} }
@Override @Override
public Boolean newsSourceExist(String source) { public Boolean newsSourceExist(String source, Long agentId) {
return getSessionTemplate().selectOne(getStatement("newsSourceExist"),source); Map<String,Object>map = new HashMap<>();
map.put("agentId", agentId);
map.put("source", source);
return getSessionTemplate().selectOne(getStatement("newsSourceExist"), map);
} }
@Override @Override
...@@ -116,15 +145,22 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet ...@@ -116,15 +145,22 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
} }
@Override @Override
public String getUrlNumberByJumpUrl(String jumpUrl) { public String getUrlNumberByJumpUrl(String jumpUrl, Long agentId) {
if (null == agentId){
agentId = 0L;
}
Map<String, Object> map = new HashMap<>();
map.put("jumpUrl", jumpUrl);
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("getUrlNumberByJumpUrl"), jumpUrl); return getSessionTemplate().selectOne(getStatement("getUrlNumberByJumpUrl"), jumpUrl);
} }
@Override @Override
public Boolean urlNumberExist(String urlNumber, Long id) { public Boolean urlNumberExist(String urlNumber, Long id, Long agentId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("urlNumber", urlNumber); map.put("urlNumber", urlNumber);
map.put("id", id); map.put("id", id);
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map); return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map);
} }
...@@ -160,13 +196,18 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet ...@@ -160,13 +196,18 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
} }
@Override @Override
public List<AppletNewsCustomTagDTO> getCustomTagList() { public List<AppletNewsCustomTagDTO> getCustomTagList(Long agentId) {
return getSessionTemplate().selectList(getStatement("getCustomTagList")); Map<String,Object> map = new HashMap<>();
map.put("agentId", agentId);
return getSessionTemplate().selectList(getStatement("getCustomTagList"), map);
} }
@Override @Override
public Boolean customTagExist(String customTag) { public Boolean customTagExist(String customTag, Long agentId) {
return getSessionTemplate().selectOne(getStatement("customTagExist"), customTag); Map<String,Object> map = new HashMap<>();
map.put("customTag", customTag);
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("customTagExist"), map);
} }
@Override @Override
......
package com.pcloud.book.applet.dto;
import com.pcloud.common.dto.BaseDto;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName com.pcloud.book.applet.dto.AddAppletGroupDTO
* @Author zhuyajie
* @Description 添加学舍群
* @Date 2020/7/21 16:23
* @Version 1.0
**/
@Data
@ApiModel("添加学舍群")
public class AddAppletGroupDTO extends BaseDto {
@ApiModelProperty("共读模板id")
private List<Long> groupActivityIds;
@ApiModelProperty("出版社id")
private Long agentId;
}
...@@ -21,5 +21,7 @@ public class AppletNewsCustomTagDTO extends BaseDto { ...@@ -21,5 +21,7 @@ public class AppletNewsCustomTagDTO extends BaseDto {
@ApiModelProperty("资讯ids") @ApiModelProperty("资讯ids")
private List<Long> newsIds; private List<Long> newsIds;
@ApiModelProperty("出版社id")
private Long agentId;
} }
...@@ -23,4 +23,7 @@ public class AppletBanner extends BaseEntity { ...@@ -23,4 +23,7 @@ public class AppletBanner extends BaseEntity {
@ApiModelProperty("是否展示") @ApiModelProperty("是否展示")
private Boolean showState; private Boolean showState;
@ApiModelProperty("出版社id")
private Long agentId;
} }
package com.pcloud.book.applet.entity;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
/**
* 出版社小程序分类菜单权限(AppletBookClassifyAgent)实体类
*
* @author makejava
* @since 2020-07-17 16:49:50
*/
@Data
public class AppletBookClassifyAgent extends BaseEntity {
private static final long serialVersionUID = -75605877443800137L;
/**
* 小程序书刊分类id
*/
private Long appletBookClassifyId;
/**
* 出版社id
*/
private Long agentId;
/**
* 客户端是否展示
*/
private Boolean showState;
/**
* 分类名称
*/
private String classifyName;
/** 排序值
*/
private Integer seq;
/**
* 图标
*/
private String pic;
}
\ No newline at end of file
...@@ -20,4 +20,7 @@ public class AppletBooklistClassify extends BaseEntity { ...@@ -20,4 +20,7 @@ public class AppletBooklistClassify extends BaseEntity {
@ApiModelProperty("图标") @ApiModelProperty("图标")
private String pic; private String pic;
@ApiModelProperty("出版社id")
private Long agentId;
} }
...@@ -35,4 +35,6 @@ public class AppletGroupManage extends BaseEntity { ...@@ -35,4 +35,6 @@ public class AppletGroupManage extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
@ApiModelProperty("出版社id")
private Long agentId;
} }
\ No newline at end of file
...@@ -101,6 +101,8 @@ public class AppletNews extends BaseTempletClassify { ...@@ -101,6 +101,8 @@ public class AppletNews extends BaseTempletClassify {
@ApiModelProperty("城市") @ApiModelProperty("城市")
private String city; private String city;
@ApiModelProperty("出版社id")
private Long agentId;
@ApiModelProperty("选取的服务") @ApiModelProperty("选取的服务")
List<AppletNewsServe> appletNewsServeList; List<AppletNewsServe> appletNewsServeList;
......
...@@ -20,4 +20,7 @@ public class AppletNewsClassify extends BaseEntity { ...@@ -20,4 +20,7 @@ public class AppletNewsClassify extends BaseEntity {
@ApiModelProperty("图标") @ApiModelProperty("图标")
private String pic; private String pic;
@ApiModelProperty("出版社id")
private Long agentId;
} }
...@@ -13,4 +13,6 @@ public class AppletNewsCustomTag extends BaseEntity { ...@@ -13,4 +13,6 @@ public class AppletNewsCustomTag extends BaseEntity {
@ApiModelProperty("自定义标识") @ApiModelProperty("自定义标识")
private String customTag; private String customTag;
@ApiModelProperty("出版社id")
private Long agentId;
} }
...@@ -6,12 +6,15 @@ import com.pcloud.book.applet.dto.AppletBookClassifyDTO; ...@@ -6,12 +6,15 @@ import com.pcloud.book.applet.dto.AppletBookClassifyDTO;
import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO; import com.pcloud.book.applet.dto.AppletBookClassifyRelationDTO;
import com.pcloud.book.applet.dto.AppletUserLabelDTO; import com.pcloud.book.applet.dto.AppletUserLabelDTO;
import com.pcloud.book.applet.entity.AppletBookClassify; import com.pcloud.book.applet.entity.AppletBookClassify;
import com.pcloud.book.applet.entity.AppletBookClassifyAgent;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -65,7 +69,9 @@ public class AppletBookClassifyFacade { ...@@ -65,7 +69,9 @@ public class AppletBookClassifyFacade {
public ResponseDto<?> addUserLabel( public ResponseDto<?> addUserLabel(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestBody @ApiParam("客户端的标签") @Validated AppletUserLabelDTO appletUserLabelDTO) { @RequestBody @ApiParam("客户端的标签") @Validated AppletUserLabelDTO appletUserLabelDTO) {
SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
appletUserLabelDTO.setAgentId(agentId);
appletBookClassifyBiz.addUserLabel(appletUserLabelDTO); appletBookClassifyBiz.addUserLabel(appletUserLabelDTO);
return new ResponseDto<>(); return new ResponseDto<>();
} }
...@@ -108,16 +114,29 @@ public class AppletBookClassifyFacade { ...@@ -108,16 +114,29 @@ public class AppletBookClassifyFacade {
@GetMapping("listUserLabel") @GetMapping("listUserLabel")
public ResponseDto<List<AppletUserLabelDTO>> listUserLabel( public ResponseDto<List<AppletUserLabelDTO>> listUserLabel(
@RequestHeader("token") String token, @RequestParam("appletBookClassifyId") Long appletBookClassifyId) { @RequestHeader("token") String token, @RequestParam("appletBookClassifyId") Long appletBookClassifyId) {
SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
List<AppletUserLabelDTO> appletUserLabelDTOS = appletBookClassifyBiz.listUserLabel(appletBookClassifyId); Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
List<AppletUserLabelDTO> appletUserLabelDTOS = appletBookClassifyBiz.listUserLabel(appletBookClassifyId, agentId);
return new ResponseDto<>(appletUserLabelDTOS); return new ResponseDto<>(appletUserLabelDTOS);
} }
@ApiOperation("获取书刊分类列表及其标签") @ApiOperation("获取书刊分类列表及其标签")
@GetMapping("getAllBookClassifyAndLabel4Wechat") @GetMapping("getAllBookClassifyAndLabel4Wechat")
public ResponseDto<List<AppletBookClassifyDTO>> getAllBookClassifyAndLabel4Wechat(@RequestParam(value = "grayStatus",required = false) String grayStatus){ public ResponseDto<List<AppletBookClassifyDTO>> getAllBookClassifyAndLabel4Wechat(
return new ResponseDto<>(appletBookClassifyBiz.getAllBookClassifyAndLabel(grayStatus)); @CookieValue("userInfo") String userInfo,
@RequestParam(value = "grayStatus",required = false) String grayStatus){
Long officialAccountsId = Cookie.getId(userInfo,Cookie._OFFICIAL_ACCOUNTS_ID);
return new ResponseDto<>(appletBookClassifyBiz.getAllBookClassifyAndLabel4Wechat(grayStatus, officialAccountsId));
}
@ApiOperation("客户端标签列表")
@GetMapping("listUserLabel4Wechat")
public ResponseDto<List<AppletUserLabelDTO>> listUserLabel4Wechat(
@CookieValue("userInfo") String userInfo, @RequestParam("appletBookClassifyId") Long appletBookClassifyId) {
Long officialAccountsId = Cookie.getId(userInfo,Cookie._OFFICIAL_ACCOUNTS_ID);
List<AppletUserLabelDTO> appletUserLabelDTOS = appletBookClassifyBiz.listUserLabel4Wechat(appletBookClassifyId, officialAccountsId);
return new ResponseDto<>(appletUserLabelDTOS);
} }
@ApiOperation("平台端获取二级分类") @ApiOperation("平台端获取二级分类")
...@@ -127,4 +146,33 @@ public class AppletBookClassifyFacade { ...@@ -127,4 +146,33 @@ public class AppletBookClassifyFacade {
List<AssistTempletDTO> list = appletBookClassifyBiz.getChildTempletList(appletBookClassifyId); List<AssistTempletDTO> list = appletBookClassifyBiz.getChildTempletList(appletBookClassifyId);
return new ResponseDto<>(list); return new ResponseDto<>(list);
} }
@ApiOperation("小睿出版社修改客户端分类展示状态、名称")
@PostMapping("updateBaseInfoByAgent")
public ResponseDto<?> updateBaseInfoByAgent(@RequestHeader("token") String token, @RequestBody @ApiParam AppletBookClassifyAgent appletBookClassifyAgent){
Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
appletBookClassifyAgent.setAgentId(agentId);
appletBookClassifyBiz.updateBaseInfoByAgent(appletBookClassifyAgent);
return new ResponseDto<>();
}
@ApiOperation("小睿出版管理端书刊分类查询")
@GetMapping("getAppletBookClassifyListByAgent")
public ResponseDto<List<AppletBookClassifyDTO>> getAppletBookClassifyListByAgent(
@RequestHeader("token") String token,
@RequestParam(value = "showState", required = false) Boolean showState) {
Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(appletBookClassifyBiz.getAppletBookClassifyListByAgent(agentId, showState));
}
@ApiOperation("客户端书刊分类查询")
@GetMapping("getAppletBookClassifyList4Wechat")
public ResponseDto<List<AppletBookClassifyDTO>> getAppletBookClassifyList4Wechat(
@CookieValue("userInfo") String userInfo,
@RequestParam(value = "showState", required = false) Boolean showState) {
Long officialAccountsId = Cookie.getId(userInfo,Cookie._OFFICIAL_ACCOUNTS_ID);
return new ResponseDto<>(appletBookClassifyBiz.getAppletBookClassifyList4Wechat(officialAccountsId, showState));
}
} }
package com.pcloud.book.applet.facade; package com.pcloud.book.applet.facade;
import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz; import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz;
import com.pcloud.book.applet.dto.AddAppletGroupDTO;
import com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO; import com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO;
import com.pcloud.book.applet.biz.AppletGroupManageBiz; import com.pcloud.book.applet.biz.AppletGroupManageBiz;
import com.pcloud.book.applet.entity.AppletGroupSearchRecord; import com.pcloud.book.applet.entity.AppletGroupSearchRecord;
...@@ -8,6 +9,7 @@ import com.pcloud.book.base.exception.BookBizException; ...@@ -8,6 +9,7 @@ import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil; import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie; import com.pcloud.common.utils.cookie.Cookie;
...@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 学舍群管理(AppletGroupManage)表控制层 * 学舍群管理(AppletGroupManage)表控制层
...@@ -41,8 +44,9 @@ public class AppletGroupManageFacade { ...@@ -41,8 +44,9 @@ public class AppletGroupManageFacade {
@RequestParam(value = "currentPage", defaultValue = "0") Integer currentPage, @RequestParam(value = "currentPage", defaultValue = "0") Integer currentPage,
@RequestParam(value = "numPerPage", defaultValue = "10") Integer numPerPage) @RequestParam(value = "numPerPage", defaultValue = "10") Integer numPerPage)
throws BizException, PermissionException { throws BizException, PermissionException {
SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
return new ResponseDto<>(appletGroupManageBiz.getList(name, currentPage, numPerPage)); Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(appletGroupManageBiz.getList(name, currentPage, numPerPage, agentId));
} }
@ApiOperation("社群任意门Applet") @ApiOperation("社群任意门Applet")
...@@ -53,10 +57,11 @@ public class AppletGroupManageFacade { ...@@ -53,10 +57,11 @@ public class AppletGroupManageFacade {
@RequestParam(value = "numPerPage", defaultValue = "5") Integer numPerPage) @RequestParam(value = "numPerPage", defaultValue = "5") Integer numPerPage)
throws BizException, PermissionException { throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if(!NumberUtil.isNumber(wechatUserId)){ if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION; throw BookBizException.PARAM_DELETION;
} }
return new ResponseDto<>(appletGroupManageBiz.getList4Applet(wechatUserId, recommend, currentPage, numPerPage)); return new ResponseDto<>(appletGroupManageBiz.getList4Applet(wechatUserId, recommend, currentPage, numPerPage,officialAccountsId));
} }
@ApiOperation("新增社群") @ApiOperation("新增社群")
...@@ -64,7 +69,22 @@ public class AppletGroupManageFacade { ...@@ -64,7 +69,22 @@ public class AppletGroupManageFacade {
public ResponseDto<?> insert(@RequestHeader("token") String token, @RequestBody List<Long> groupActivityIds) public ResponseDto<?> insert(@RequestHeader("token") String token, @RequestBody List<Long> groupActivityIds)
throws BizException, PermissionException { throws BizException, PermissionException {
SessionUtil.getToken4Redis(token); SessionUtil.getToken4Redis(token);
appletGroupManageBiz.insert(groupActivityIds); appletGroupManageBiz.insert(groupActivityIds,0L);
return new ResponseDto<>();
}
@ApiOperation("小睿小程序管理端新增社群")
@PostMapping("insertByAgent")
public ResponseDto<?> insertByAgent(@RequestHeader("token") String token, @RequestBody AddAppletGroupDTO addAppletGroupDTO)
throws BizException, PermissionException {
Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
addAppletGroupDTO.setAgentId(agentId);
if (null == addAppletGroupDTO || ListUtils.isEmpty(addAppletGroupDTO.getGroupActivityIds())
|| null ==addAppletGroupDTO.getAgentId()){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
}
appletGroupManageBiz.insert(addAppletGroupDTO.getGroupActivityIds(), addAppletGroupDTO.getAgentId());
return new ResponseDto<>(); return new ResponseDto<>();
} }
...@@ -110,7 +130,7 @@ public class AppletGroupManageFacade { ...@@ -110,7 +130,7 @@ public class AppletGroupManageFacade {
if(!NumberUtil.isNumber(wechatUserId)){ if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION; throw BookBizException.PARAM_DELETION;
} }
return new ResponseDto<>(appletGroupSearchRecordBiz.getList(wechatUserId, isMore, currentPage, numPerPage)); return new ResponseDto<>(appletGroupSearchRecordBiz.getList(wechatUserId, isMore, currentPage, numPerPage, null));
} }
@ApiOperation("删除共读社群记录") @ApiOperation("删除共读社群记录")
...@@ -131,10 +151,11 @@ public class AppletGroupManageFacade { ...@@ -131,10 +151,11 @@ public class AppletGroupManageFacade {
) )
throws BizException, PermissionException { throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if(!NumberUtil.isNumber(wechatUserId)){ if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION; throw BookBizException.PARAM_DELETION;
} }
return new ResponseDto<>(appletGroupSearchRecordBiz.getTishBookSchoolList(wechatUserId, bookGroupId)); return new ResponseDto<>(appletGroupSearchRecordBiz.getTishBookSchoolList(wechatUserId, bookGroupId, officialAccountsId));
} }
@ApiOperation("用户社群书记录id列表") @ApiOperation("用户社群书记录id列表")
...@@ -155,9 +176,10 @@ public class AppletGroupManageFacade { ...@@ -155,9 +176,10 @@ public class AppletGroupManageFacade {
@RequestParam("currentPage") Integer currentPage) @RequestParam("currentPage") Integer currentPage)
throws BizException, PermissionException { throws BizException, PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if(!NumberUtil.isNumber(wechatUserId)){ if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION; throw BookBizException.PARAM_DELETION;
} }
return new ResponseDto<>(appletGroupSearchRecordBiz.getGroupList4AppletHome(wechatUserId,currentPage,numPerPage)); return new ResponseDto<>(appletGroupSearchRecordBiz.getGroupList4AppletHome(wechatUserId,currentPage,numPerPage,officialAccountsId));
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.AppletUserLabelDTO; ...@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.AppletUserLabelDTO;
import com.pcloud.book.applet.entity.AppletUserLabel; import com.pcloud.book.applet.entity.AppletUserLabel;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -22,7 +23,7 @@ public interface AppletUserLabelMapper { ...@@ -22,7 +23,7 @@ public interface AppletUserLabelMapper {
int updateByPrimaryKey(AppletUserLabel record); int updateByPrimaryKey(AppletUserLabel record);
List<AppletLabelDTO> getBookClassifyAndLabel(); List<AppletLabelDTO> getBookClassifyAndLabel(@Param("agentId") Long agentId);
List<AppletUserLabelDTO> listUserLabel(Long appletBookClassifyId); List<AppletUserLabelDTO> listUserLabel(@Param("appletBookClassifyId") Long appletBookClassifyId, @Param("agentId") Long agentId);
} }
\ No newline at end of file
package com.pcloud.book.applet.service.impl; package com.pcloud.book.applet.service.impl;
import com.pcloud.book.applet.biz.AppletBooklistBiz; import com.pcloud.book.applet.biz.AppletBooklistBiz;
import com.pcloud.book.applet.biz.AppletBookClassifyBiz;
import com.pcloud.book.applet.biz.AppletNewsBiz; import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dto.AppletNewsVO; import com.pcloud.book.applet.dto.AppletNewsVO;
import com.pcloud.book.applet.dto.AppletOuterBookDTO; import com.pcloud.book.applet.dto.AppletOuterBookDTO;
...@@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiParam;
/** /**
* @ClassName com.pcloud.book.applet.service.impl.AppletServiceImpl * @ClassName com.pcloud.book.applet.service.impl.AppletServiceImpl
* @Author zhuyajie * @Author zhuyajie
...@@ -37,6 +40,8 @@ public class AppletServiceImpl implements AppletService { ...@@ -37,6 +40,8 @@ public class AppletServiceImpl implements AppletService {
private PcloudGroupActivityBiz pcloudGroupActivityBiz; private PcloudGroupActivityBiz pcloudGroupActivityBiz;
@Autowired @Autowired
private AppletBooklistBiz appletBooklistBiz; private AppletBooklistBiz appletBooklistBiz;
@Autowired
private AppletBookClassifyBiz appletBookClassifyBiz;
@Override @Override
...@@ -59,4 +64,10 @@ public class AppletServiceImpl implements AppletService { ...@@ -59,4 +64,10 @@ public class AppletServiceImpl implements AppletService {
public ResponseEntity<ResponseDto<AppletOuterBookDTO>> getOuterBookById(@RequestParam("outerBookId") Long outerBookId){ public ResponseEntity<ResponseDto<AppletOuterBookDTO>> getOuterBookById(@RequestParam("outerBookId") Long outerBookId){
return ResponseHandleUtil.toResponse(appletBooklistBiz.getOuterBookById(outerBookId)); return ResponseHandleUtil.toResponse(appletBooklistBiz.getOuterBookById(outerBookId));
} }
@Override
@GetMapping("createBaseClassifysToAgent")
public void createBaseClassifysToAgent(@RequestParam("agentId") @ApiParam Long agentId){
appletBookClassifyBiz.createBaseClassifysToAgent(agentId);
}
} }
...@@ -2339,6 +2339,7 @@ public class BookBizImpl implements BookBiz { ...@@ -2339,6 +2339,7 @@ public class BookBizImpl implements BookBiz {
Long raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId()); Long raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId());
String page=null;//小程序跳转页 todo String page=null;//小程序跳转页 todo
List<BookAppletScene> list=new ArrayList<>(); List<BookAppletScene> list=new ArrayList<>();
Long accoutnSettingId = bookGroupBiz.getAccountSettingByAdviser(adviserId);
for (Long sceneId:sceneIds){ for (Long sceneId:sceneIds){
//通过sceneId查询是否已经存在,如果已经存在就不创建 //通过sceneId查询是否已经存在,如果已经存在就不创建
BookAppletScene appletScene = bookAppletSceneDao.getBySceneId(sceneId); BookAppletScene appletScene = bookAppletSceneDao.getBySceneId(sceneId);
...@@ -2351,12 +2352,13 @@ public class BookBizImpl implements BookBiz { ...@@ -2351,12 +2352,13 @@ public class BookBizImpl implements BookBiz {
appletId = createOneAppletId(); appletId = createOneAppletId();
applet = bookAppletSceneDao.getByAppletId(appletId); applet = bookAppletSceneDao.getByAppletId(appletId);
} }
String url = wechatConsr.create4MiniApp(777L, appletId, null, page); String url = wechatConsr.create4MiniApp(accoutnSettingId, appletId, null, page);
BookAppletScene bookAppletScene = new BookAppletScene(); BookAppletScene bookAppletScene = new BookAppletScene();
bookAppletScene.setRaysClassifyId(raysClassifyId); bookAppletScene.setRaysClassifyId(raysClassifyId);
bookAppletScene.setAppletId(appletId); bookAppletScene.setAppletId(appletId);
bookAppletScene.setAppletUrl(url); bookAppletScene.setAppletUrl(url);
bookAppletScene.setSceneId(sceneId); bookAppletScene.setSceneId(sceneId);
bookAppletScene.setAccountSettingId(accoutnSettingId);
list.add(bookAppletScene); list.add(bookAppletScene);
} }
bookAppletSceneDao.insert(list); bookAppletSceneDao.insert(list);
......
...@@ -883,7 +883,11 @@ public class BookFacadeImpl implements BookFacade { ...@@ -883,7 +883,11 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "currentPage") Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage @RequestParam(value = "numPerPage") Integer numPerPage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long rayAgentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
if (null != rayAgentId && rayAgentId > 0) {
agentId = rayAgentId;
}
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
......
...@@ -7,7 +7,10 @@ import com.pcloud.channelcenter.base.exceptions.ChannelBizException; ...@@ -7,7 +7,10 @@ import com.pcloud.channelcenter.base.exceptions.ChannelBizException;
import com.pcloud.channelcenter.qrcode.dto.MapResourceCountDTO; import com.pcloud.channelcenter.qrcode.dto.MapResourceCountDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeMessageDTO; import com.pcloud.channelcenter.qrcode.dto.QrcodeMessageDTO;
import com.pcloud.channelcenter.qrcode.service.QrcodeSceneService; import com.pcloud.channelcenter.qrcode.service.QrcodeSceneService;
import com.pcloud.channelcenter.wechat.entity.AccountSetting;
import com.pcloud.channelcenter.wechat.service.AccountSettingService;
import com.pcloud.channelcenter.wechat.service.MessageService; import com.pcloud.channelcenter.wechat.service.MessageService;
import com.pcloud.common.core.aspect.ParamLog;
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.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
...@@ -39,6 +42,8 @@ public class ChannelConsr { ...@@ -39,6 +42,8 @@ public class ChannelConsr {
private MessageService messageService; private MessageService messageService;
@Autowired @Autowired
private QrcodeSceneService qrcodeSceneService; private QrcodeSceneService qrcodeSceneService;
@Autowired
private AccountSettingService accountSettingService;
/** /**
* 获取渠道名称 * 获取渠道名称
...@@ -170,4 +175,28 @@ public class ChannelConsr { ...@@ -170,4 +175,28 @@ public class ChannelConsr {
Map<String, QrcodeMessageDTO> mapQrcodeMessage = ResponseHandleUtil.parseMap(qrcodeSceneService.mapResourceCount(mapResourceCountDTO), String.class, QrcodeMessageDTO.class); Map<String, QrcodeMessageDTO> mapQrcodeMessage = ResponseHandleUtil.parseMap(qrcodeSceneService.mapResourceCount(mapResourceCountDTO), String.class, QrcodeMessageDTO.class);
return mapQrcodeMessage; return mapQrcodeMessage;
} }
@ParamLog("获取公众号基本信息")
public AccountSetting getAppInfo(Long officialAccountsId){
AccountSetting accountSetting = new AccountSetting();
try {
accountSetting = ResponseHandleUtil.parseResponse(accountSettingService.getAppInfo(officialAccountsId), AccountSetting.class);
}catch (Exception e){
LOGGER.error("调用accountSettingService.getAppInfo失败" + e.getMessage(), e);
}
return accountSetting;
}
@ParamLog("获取出版社对应的小程序公众号id")
public Long getAccountSettingIdByAgentId(Long agentId) {
Long accountSettingId = null;
try {
accountSettingId = ResponseHandleUtil.parseResponse(accountSettingService.getAccountSettingIdByAgentId(agentId), Long.class);
}catch (Exception e){
LOGGER.error("调用getAccountSettingIdByAgentId失败"+e.getMessage(),e);
}
return accountSettingId;
}
} }
...@@ -18,7 +18,7 @@ public interface GiftCouponPackageBiz { ...@@ -18,7 +18,7 @@ public interface GiftCouponPackageBiz {
void createGiftReceive(GiftReceive giftReceive); void createGiftReceive(GiftReceive giftReceive);
PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state,Integer couponType, Integer currentPage, Integer numPerPage); PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state,Integer couponType, Integer currentPage, Integer numPerPage, Long agentId);
PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Integer state,Long wechatUserId,Integer currentPage, Integer numPerPage); PageBeanNew<MyGiftPackageDTO> list4MyGiftPackage(Integer state,Long wechatUserId,Integer currentPage, Integer numPerPage);
...@@ -32,7 +32,7 @@ public interface GiftCouponPackageBiz { ...@@ -32,7 +32,7 @@ public interface GiftCouponPackageBiz {
* @date:2020/5/11 17:48 * @date:2020/5/11 17:48
* * @param null * * @param null
*/ */
String getUrlNumberByUrl(String url); String getUrlNumberByUrl(String url, Long agentId);
/** /**
* 兑换券使用分析 * 兑换券使用分析
...@@ -40,5 +40,5 @@ public interface GiftCouponPackageBiz { ...@@ -40,5 +40,5 @@ public interface GiftCouponPackageBiz {
* @date:2020/5/11 19:29 * @date:2020/5/11 19:29
* * @param null * * @param null
*/ */
PageBeanNew<GiftPackageDTO> listGiftPackage4Analysis(String title, Integer state, Integer couponType, Integer currentPage, Integer numPerPage, Integer linkOnly,Integer clickQty); PageBeanNew<GiftPackageDTO> listGiftPackage4Analysis(String title, Integer state, Integer couponType, Integer currentPage, Integer numPerPage, Integer linkOnly,Integer clickQty, Long agentId);
} }
...@@ -52,6 +52,9 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -52,6 +52,9 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
@Override @Override
public void createGiftPackage(GiftCouponPackage giftCouponPackage) { public void createGiftPackage(GiftCouponPackage giftCouponPackage) {
giftParamCheck.checkGiftAddParam(giftCouponPackage); giftParamCheck.checkGiftAddParam(giftCouponPackage);
if (null == giftCouponPackage.getAgentId()){
giftCouponPackage.setAgentId(0L);
}
if (urlNumberExist(giftCouponPackage)){ if (urlNumberExist(giftCouponPackage)){
throw new BookBizException(BookBizException.ERROR,"链接编号重复"); throw new BookBizException(BookBizException.ERROR,"链接编号重复");
} }
...@@ -66,6 +69,11 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -66,6 +69,11 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
@Override @Override
public void updateGiftPackage(GiftCouponPackage giftCouponPackage) { public void updateGiftPackage(GiftCouponPackage giftCouponPackage) {
giftParamCheck.checkGiftAddParam(giftCouponPackage); giftParamCheck.checkGiftAddParam(giftCouponPackage);
if (null == giftCouponPackage.getId()){
throw new BookBizException(BookBizException.ERROR,"id为空");
}
GiftCouponPackage couponPackage = giftCouponPackageDao.getById(giftCouponPackage.getId());
giftCouponPackage.setAgentId(couponPackage.getAgentId());
if (urlNumberExist(giftCouponPackage)){ if (urlNumberExist(giftCouponPackage)){
throw new BookBizException(BookBizException.ERROR,"链接编号重复"); throw new BookBizException(BookBizException.ERROR,"链接编号重复");
} }
...@@ -87,11 +95,12 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -87,11 +95,12 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
} }
@Override @Override
public PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state, Integer couponType,Integer currentPage, Integer numPerPage) { public PageBeanNew<GiftPackageDTO> list4GiftPackage(String title, Integer state, Integer couponType,Integer currentPage, Integer numPerPage, Long agentId) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("title", title); paramMap.put("title", title);
paramMap.put("state", state); paramMap.put("state", state);
paramMap.put("couponType", couponType); paramMap.put("couponType", couponType);
paramMap.put("agentId", agentId);
PageBeanNew<GiftPackageDTO> pageBeanNew=giftCouponPackageDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "list4GiftPackage"); PageBeanNew<GiftPackageDTO> pageBeanNew=giftCouponPackageDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "list4GiftPackage");
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
...@@ -204,20 +213,21 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -204,20 +213,21 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
} }
@Override @Override
public String getUrlNumberByUrl(String url) { public String getUrlNumberByUrl(String url, Long agentId) {
if (StringUtil.isEmpty(url)){ if (StringUtil.isEmpty(url)){
return ""; return "";
} }
return giftCouponPackageDao.getUrlNumberByAddress(url); return giftCouponPackageDao.getUrlNumberByAddress(url, agentId);
} }
@Override @Override
public PageBeanNew<GiftPackageDTO> listGiftPackage4Analysis(String title, Integer state, Integer couponType, Integer currentPage, Integer numPerPage, Integer linkOnly,Integer clickQty) { public PageBeanNew<GiftPackageDTO> listGiftPackage4Analysis(String title, Integer state, Integer couponType, Integer currentPage, Integer numPerPage, Integer linkOnly,Integer clickQty, Long agentId) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("title", title); paramMap.put("title", title);
paramMap.put("state", state); paramMap.put("state", state);
paramMap.put("couponType", couponType); paramMap.put("couponType", couponType);
paramMap.put("linkOnly",linkOnly); paramMap.put("linkOnly",linkOnly);
paramMap.put("agentId", agentId);
PageBeanNew<GiftPackageDTO> pageBeanNew=giftCouponPackageDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listGiftPackage4Analysis"); PageBeanNew<GiftPackageDTO> pageBeanNew=giftCouponPackageDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listGiftPackage4Analysis");
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
...@@ -272,7 +282,7 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz { ...@@ -272,7 +282,7 @@ public class GiftCouponPackageBizImpl implements GiftCouponPackageBiz {
return exist; return exist;
} }
if (!StringUtil.isEmpty(giftCouponPackage.getExchangeAddress()) && !StringUtil.isEmpty(giftCouponPackage.getUrlNumber())) { if (!StringUtil.isEmpty(giftCouponPackage.getExchangeAddress()) && !StringUtil.isEmpty(giftCouponPackage.getUrlNumber())) {
exist = giftCouponPackageDao.urlNumberExist(giftCouponPackage.getExchangeAddress(), giftCouponPackage.getUrlNumber(), giftCouponPackage.getId()); exist = giftCouponPackageDao.urlNumberExist(giftCouponPackage.getExchangeAddress(), giftCouponPackage.getUrlNumber(), giftCouponPackage.getId(), giftCouponPackage.getAgentId());
} }
return exist; return exist;
} }
......
...@@ -71,7 +71,7 @@ public class GiftParamCheck { ...@@ -71,7 +71,7 @@ public class GiftParamCheck {
if (giftCouponPackage.getReceiveLimit()<COUPON_MIN_RECEIVE) { if (giftCouponPackage.getReceiveLimit()<COUPON_MIN_RECEIVE) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "领取上限最低"+COUPON_MIN_RECEIVE+"张"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "领取上限最低"+COUPON_MIN_RECEIVE+"张");
} }
if (null == giftCouponPackage.getValidDateBegin() || null==giftCouponPackage.getValidDateEnd()) { if (StringUtil.isEmpty(giftCouponPackage.getValidDateBegin()) || StringUtil.isEmpty(giftCouponPackage.getValidDateEnd())) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "有效期为空"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "有效期为空");
} }
if (DateUtils.getDateByStr(giftCouponPackage.getValidDateBegin()).after(DateUtils.getDateByStr((giftCouponPackage.getValidDateEnd())))) { if (DateUtils.getDateByStr(giftCouponPackage.getValidDateBegin()).after(DateUtils.getDateByStr((giftCouponPackage.getValidDateEnd())))) {
......
...@@ -26,7 +26,7 @@ public interface GiftCouponPackageDao extends BaseDao<GiftCouponPackage> { ...@@ -26,7 +26,7 @@ public interface GiftCouponPackageDao extends BaseDao<GiftCouponPackage> {
void reduceStockBatch(List<Long> packageIds); void reduceStockBatch(List<Long> packageIds);
String getUrlNumberByAddress(String exchangeAddress); String getUrlNumberByAddress(String exchangeAddress, Long agentId);
/** /**
* 链接编号是否存在 * 链接编号是否存在
...@@ -34,5 +34,5 @@ public interface GiftCouponPackageDao extends BaseDao<GiftCouponPackage> { ...@@ -34,5 +34,5 @@ public interface GiftCouponPackageDao extends BaseDao<GiftCouponPackage> {
* @date:2020/5/11 18:43 * @date:2020/5/11 18:43
* * @param null * * @param null
*/ */
Boolean urlNumberExist(String exchangeAddress, String urlNumber, Long id); Boolean urlNumberExist(String exchangeAddress, String urlNumber, Long id, Long agentId);
} }
\ No newline at end of file
...@@ -48,16 +48,20 @@ public class GiftCouponPackageDaoImpl extends BaseDaoImpl<GiftCouponPackage> imp ...@@ -48,16 +48,20 @@ public class GiftCouponPackageDaoImpl extends BaseDaoImpl<GiftCouponPackage> imp
} }
@Override @Override
public String getUrlNumberByAddress(String exchangeAddress) { public String getUrlNumberByAddress(String exchangeAddress, Long agentId) {
return getSessionTemplate().selectOne(getStatement("getUrlNumberByAddress"), exchangeAddress); Map<String,Object> map = new HashMap<>();
map.put("agentId", agentId);
map.put("exchangeAddress", exchangeAddress);
return getSessionTemplate().selectOne(getStatement("getUrlNumberByAddress"), map);
} }
@Override @Override
public Boolean urlNumberExist(String exchangeAddress, String urlNumber, Long id) { public Boolean urlNumberExist(String exchangeAddress, String urlNumber, Long id, Long agentId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("exchangeAddress", exchangeAddress); map.put("exchangeAddress", exchangeAddress);
map.put("urlNumber", urlNumber); map.put("urlNumber", urlNumber);
map.put("id", id); map.put("id", id);
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map); return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map);
} }
} }
...@@ -63,4 +63,5 @@ public class GiftCouponPackage extends BaseEntity { ...@@ -63,4 +63,5 @@ public class GiftCouponPackage extends BaseEntity {
*/ */
private String urlNumber; private String urlNumber;
private Long agentId;
} }
\ No newline at end of file
...@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.ws.rs.POST; import javax.ws.rs.POST;
...@@ -56,8 +57,12 @@ public class GiftCouponPackageFacade { ...@@ -56,8 +57,12 @@ public class GiftCouponPackageFacade {
@ApiOperation("新增礼券包") @ApiOperation("新增礼券包")
@PostMapping("/createGiftPackage") @PostMapping("/createGiftPackage")
public ResponseDto<?> createGiftPackage( public ResponseDto<?> createGiftPackage(
@RequestHeader("token") String token,
@RequestBody GiftCouponPackage giftCouponPackage @RequestBody GiftCouponPackage giftCouponPackage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
giftCouponPackage.setAgentId(agentId);
giftCouponPackageBiz.createGiftPackage(giftCouponPackage); giftCouponPackageBiz.createGiftPackage(giftCouponPackage);
return new ResponseDto<>(); return new ResponseDto<>();
} }
...@@ -91,13 +96,16 @@ public class GiftCouponPackageFacade { ...@@ -91,13 +96,16 @@ public class GiftCouponPackageFacade {
@ApiOperation("礼券包列表") @ApiOperation("礼券包列表")
@GetMapping("/list4GiftPackage") @GetMapping("/list4GiftPackage")
public ResponseDto<PageBeanNew<GiftPackageDTO>> list4GiftPackage( public ResponseDto<PageBeanNew<GiftPackageDTO>> list4GiftPackage(
@RequestHeader("token") String token,
@RequestParam(value = "title",required = false) @ApiParam("礼包券名称") String title, @RequestParam(value = "title",required = false) @ApiParam("礼包券名称") String title,
@RequestParam(value = "state",required = false) @ApiParam("状态") Integer state, @RequestParam(value = "state",required = false) @ApiParam("状态") Integer state,
@RequestParam(value = "couponType",required = false) @ApiParam("券类型") Integer couponType, @RequestParam(value = "couponType",required = false) @ApiParam("券类型") Integer couponType,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage @RequestParam(value = "numPerPage", required = false) Integer numPerPage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
return new ResponseDto<>(giftCouponPackageBiz.list4GiftPackage(title,state,couponType,currentPage,numPerPage)); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(giftCouponPackageBiz.list4GiftPackage(title,state,couponType,currentPage,numPerPage,agentId));
} }
@ApiOperation("新增礼券包领取") @ApiOperation("新增礼券包领取")
...@@ -148,9 +156,11 @@ public class GiftCouponPackageFacade { ...@@ -148,9 +156,11 @@ public class GiftCouponPackageFacade {
@ApiOperation("根据链接地址获取外链编号") @ApiOperation("根据链接地址获取外链编号")
@GetMapping("getUrlNumberByUrl") @GetMapping("getUrlNumberByUrl")
public ResponseDto<String> getUrlNumberByUrl(@RequestHeader("token") String token, @RequestParam(value = "url",required = false) String url){ public ResponseDto<String> getUrlNumberByUrl(
SessionUtil.getToken4Redis(token); @RequestHeader("token") String token, @RequestParam(value = "url",required = false) String url){
return new ResponseDto<>(giftCouponPackageBiz.getUrlNumberByUrl(url)); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(giftCouponPackageBiz.getUrlNumberByUrl(url,agentId));
} }
@ApiOperation("兑换券使用分析") @ApiOperation("兑换券使用分析")
...@@ -165,8 +175,9 @@ public class GiftCouponPackageFacade { ...@@ -165,8 +175,9 @@ public class GiftCouponPackageFacade {
@RequestParam(value = "clickQty", required = false) @ApiParam("点击量") Integer clickQty, @RequestParam(value = "clickQty", required = false) @ApiParam("点击量") Integer clickQty,
@RequestParam(value = "linkOnly",required = false) @ApiParam("只看第三方") Integer linkOnly @RequestParam(value = "linkOnly",required = false) @ApiParam("只看第三方") Integer linkOnly
) throws BizException, PermissionException { ) throws BizException, PermissionException {
SessionUtil.getInfoToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
return new ResponseDto<>(giftCouponPackageBiz.listGiftPackage4Analysis(title, state, couponType, currentPage, numPerPage, linkOnly,clickQty)); Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(giftCouponPackageBiz.listGiftPackage4Analysis(title, state, couponType, currentPage, numPerPage, linkOnly,clickQty, agentId));
} }
} }
...@@ -931,4 +931,20 @@ public interface BookGroupBiz { ...@@ -931,4 +931,20 @@ public interface BookGroupBiz {
* * @param null * * @param null
*/ */
BookGroupDTO getMaxScanCountBookGroup(Long agentId, Integer joinGroupType); BookGroupDTO getMaxScanCountBookGroup(Long agentId, Integer joinGroupType);
/**
* 获取小睿社群书列表(小睿独立管理端)
* @author:zhuyajie
* @date:2020/7/22 11:06
* * @param null
*/
PageBean listBookGroup4AppletAgent(Map<String, Object> paramMap, PageParam pageParam);
/**
* 根据编辑获取对应的小程序
* @author:zhuyajie
* @date:2020/7/28 16:29
* * @param null
*/
public Long getAccountSettingByAdviser(Long adviserId);
} }
...@@ -258,4 +258,5 @@ public interface GroupQrcodeBiz { ...@@ -258,4 +258,5 @@ public interface GroupQrcodeBiz {
List<String> migrateMaterial(MaterialMigrateDTO migrateDTO); List<String> migrateMaterial(MaterialMigrateDTO migrateDTO);
void syncGroupMaterial(Map<String, Long> accountMap); void syncGroupMaterial(Map<String, Long> accountMap);
PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage, Long officialAccountsId);
} }
...@@ -39,6 +39,7 @@ import com.pcloud.book.consumer.settlement.SettlementConsr; ...@@ -39,6 +39,7 @@ import com.pcloud.book.consumer.settlement.SettlementConsr;
import com.pcloud.book.consumer.trade.TradeConsr; import com.pcloud.book.consumer.trade.TradeConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.AgentConsr; import com.pcloud.book.consumer.user.AgentConsr;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.consumer.wechat.WechatConsr; import com.pcloud.book.consumer.wechat.WechatConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr; import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.BookGroupAppBiz; import com.pcloud.book.group.biz.BookGroupAppBiz;
...@@ -432,6 +433,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -432,6 +433,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private BizMaterialMapper bizMaterialMapper; private BizMaterialMapper bizMaterialMapper;
@Autowired @Autowired
private PcloudGroupActivityBiz pcloudGroupActivityBiz; private PcloudGroupActivityBiz pcloudGroupActivityBiz;
@Autowired
private ChannelConsr channelConsr;
private static final ThreadPoolExecutor PLATFORM_STATISTICS_EXPORT_THREAD = new ThreadPoolExecutor(2, 2, private static final ThreadPoolExecutor PLATFORM_STATISTICS_EXPORT_THREAD = new ThreadPoolExecutor(2, 2,
0, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), 0, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
...@@ -4822,25 +4825,28 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -4822,25 +4825,28 @@ public class BookGroupBizImpl implements BookGroupBiz {
appletId = createOneAppletId(); appletId = createOneAppletId();
applet = bookAppletSceneDao.getByAppletId(appletId); applet = bookAppletSceneDao.getByAppletId(appletId);
} }
String url = wechatConsr.create4MiniApp(777L, appletId, null, page); Long accoutnSettingId = getAccountSettingByAdviser(adviserId);
String url = wechatConsr.create4MiniApp(accoutnSettingId, appletId, null, page);
BookAppletScene bookAppletScene = new BookAppletScene(); BookAppletScene bookAppletScene = new BookAppletScene();
bookAppletScene.setBookGroupId(bookGroupId); bookAppletScene.setBookGroupId(bookGroupId);
bookAppletScene.setRaysClassifyId(raysClassifyId); bookAppletScene.setRaysClassifyId(raysClassifyId);
bookAppletScene.setAppletId(appletId); bookAppletScene.setAppletId(appletId);
bookAppletScene.setAppletUrl(url); bookAppletScene.setAppletUrl(url);
bookAppletScene.setAccountSettingId(accoutnSettingId);
bookAppletSceneDao.insert(bookAppletScene); bookAppletSceneDao.insert(bookAppletScene);
} }
@ParamLog("生成一个小程序id") @ParamLog("生成一个小程序id")
private String createOneAppletId() { private String createOneAppletId() {
Random random = new Random(); /*Random random = new Random();
String charStr = "0123456789abcdefghijklmnopqrstuvwxyz"; String charStr = "0123456789abcdefghijklmnopqrstuvwxyz";
String s = ""; String s = "";
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
int index = random.nextInt(charStr.length()); int index = random.nextInt(charStr.length());
s = s + charStr.charAt(index); s = s + charStr.charAt(index);
} }
return s; return s;*/
return UUIDUitl.generateString(20);
} }
@Override @Override
...@@ -5460,6 +5466,65 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5460,6 +5466,65 @@ public class BookGroupBizImpl implements BookGroupBiz {
return null; return null;
} }
@Override
public PageBean listBookGroup4AppletAgent(Map<String, Object> paramMap, PageParam pageParam) {
PageBean pageBean = bookDao.listPage(pageParam, paramMap, "listBookGroup4AppletAgent");
if (pageBean == null || ListUtils.isEmpty(pageBean.getRecordList())) {
return new PageBean(0, 0, new ArrayList<>());
}
//填充社群书数据
List<Long> relatedGroupIds = new ArrayList<>();
List<Long> adviserIds = new ArrayList<>();
pageBean.getRecordList().forEach(obj -> {
BookDto bookDto = (BookDto) obj;
if (null != bookDto.getRelatedBookGroupId() && !relatedGroupIds.contains(bookDto.getRelatedBookGroupId())) {
relatedGroupIds.add(bookDto.getRelatedBookGroupId());
}
if (null != bookDto.getAdviserId() && !adviserIds.contains(bookDto.getAdviserId())){
adviserIds.add(bookDto.getAdviserId());
}
});
Map<Long, BookGroupDTO> relatedBookGroupMap = new HashMap<>();
Map<Long, AdviserBaseInfoDto> adviserMap = new HashMap();
if (!ListUtils.isEmpty(relatedGroupIds)){
relatedBookGroupMap = bookGroupDao.mapDTOByIds(relatedGroupIds);
}
if (!ListUtils.isEmpty(adviserIds)){
adviserMap = adviserConsr.getAdviserId2AdviserInfoDtoMap(adviserIds);
}
for (Object object : pageBean.getRecordList()) {
BookDto bookDto = (BookDto) object;
Long bookGroupId = bookDto.getBookGroupId();
bookDto.setGroupQrcodeLink(bookGroupQrcodeDomain + "/" + bookGroupId);
bookDto.setBookName(null != bookDto.getBookName() ? StringUtil.addBracket(bookDto.getBookName()) : null);
if (!MapUtils.isEmpty(relatedBookGroupMap) && relatedBookGroupMap.containsKey(bookDto.getRelatedBookGroupId())) {
BookGroupDTO relatedBookGroup = relatedBookGroupMap.get(bookDto.getRelatedBookGroupId());
relatedBookGroup.setGroupQrcodeLink(bookGroupQrcodeDomain + "/" + bookDto.getRelatedBookGroupId());
bookDto.setRelatedBookGroup(relatedBookGroup);
}
if (!MapUtils.isEmpty(adviserMap) && adviserMap.containsKey(bookDto.getAdviserId())){
AdviserBaseInfoDto adviserBaseInfoDto = adviserMap.get(bookDto.getAdviserId());
bookDto.setAdviserName(adviserBaseInfoDto.getPartyName());
bookDto.setPhone(adviserBaseInfoDto.getPhoneNum());
}
}
return pageBean;
}
@Override
public Long getAccountSettingByAdviser(Long adviserId) {
Long accountSettingId = BookProps.getMiniOfficialAccountsId();
if (null == adviserId || adviserId == 0L) {
return accountSettingId;
}
Long agentId = adviserConsr.getAgentIdByAdviser(adviserId);
Long accountSetting = channelConsr.getAccountSettingIdByAgentId(agentId);
if (null != accountSetting) {
return accountSetting;
}
return accountSettingId;
}
@Override @Override
public BookGroupDTO getMaxScanCountBookGroup(Long agentId, Integer joinGroupType) { public BookGroupDTO getMaxScanCountBookGroup(Long agentId, Integer joinGroupType) {
......
...@@ -1028,12 +1028,12 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -1028,12 +1028,12 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
@Override @Override
@ParamLog(value = "获取微信用户的位置相关社群", isAfterReturn = false) @ParamLog(value = "获取微信用户的位置相关社群", isAfterReturn = false)
public PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage) { public PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage, Long officialAccountsId) {
if (currentPage == null || currentPage < 0 || numPerPage == null || numPerPage <= 0) { if (currentPage == null || currentPage < 0 || numPerPage == null || numPerPage <= 0) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "分页参数错误!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "分页参数错误!");
} }
PageBeanNew<AppletGroupManageDTO> appletGroupManageDTOPageBeanNew = pcloudGroupActivityBiz.getLocalGroup(wechatUserId, numPerPage PageBeanNew<AppletGroupManageDTO> appletGroupManageDTOPageBeanNew = pcloudGroupActivityBiz.getLocalGroup(wechatUserId, numPerPage
, currentPage); , currentPage, officialAccountsId);
return appletGroupManageDTOPageBeanNew; return appletGroupManageDTOPageBeanNew;
} }
......
...@@ -49,5 +49,8 @@ public class BookAppletSceneDTO extends BaseDto { ...@@ -49,5 +49,8 @@ public class BookAppletSceneDTO extends BaseDto {
*权益数量 *权益数量
*/ */
private Integer rightsSettingCount; private Integer rightsSettingCount;
/**
* 小程序公众号id
*/
private Long accountSettingId;
} }
...@@ -50,4 +50,8 @@ public class BookAppletScene extends BaseEntity { ...@@ -50,4 +50,8 @@ public class BookAppletScene extends BaseEntity {
* 现代纸书自建码的id * 现代纸书自建码的id
*/ */
private Long sceneId; private Long sceneId;
/**
* 小程序公众号id
*/
private Long accountSettingId;
} }
...@@ -767,4 +767,22 @@ public interface BookGroupFacade { ...@@ -767,4 +767,22 @@ public interface BookGroupFacade {
ResponseDto<?>updateBookServeTypeCode(); ResponseDto<?>updateBookServeTypeCode();
@ApiOperation(value = "获取小睿社群书列表(小睿独立管理端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "name", value = "书刊/isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑id", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")
})
@RequestMapping(value = "listBookGroup4AppletAgent", method = RequestMethod.GET)
ResponseDto<PageBean> listBookGroup4AppletAgent(
@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "adviserId", required = false) Long adviserId,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException;
} }
...@@ -9,7 +9,25 @@ import com.pcloud.book.group.dto.GroupQrcode4ClassifyDTO; ...@@ -9,7 +9,25 @@ import com.pcloud.book.group.dto.GroupQrcode4ClassifyDTO;
import com.pcloud.book.group.dto.ListBookGroup4HealsDTO; import com.pcloud.book.group.dto.ListBookGroup4HealsDTO;
import com.pcloud.book.group.dto.ListClassify4WechatDTO; import com.pcloud.book.group.dto.ListClassify4WechatDTO;
import com.pcloud.book.group.facade.BookGroupClassifyFacade; import com.pcloud.book.group.facade.BookGroupClassifyFacade;
import com.pcloud.book.group.vo.*; import com.pcloud.book.group.vo.AddClassifyVO;
import com.pcloud.book.group.vo.AdviserClassifyParam;
import com.pcloud.book.group.vo.AdviserClassifyVO;
import com.pcloud.book.group.vo.BookGroupClassifyVO;
import com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO;
import com.pcloud.book.group.vo.ClassifyAndGroupCountVO;
import com.pcloud.book.group.vo.ClassifyAndUserCountVO;
import com.pcloud.book.group.vo.ClassifyNameVO;
import com.pcloud.book.group.vo.ClassifyVO;
import com.pcloud.book.group.vo.GroupQrcode4ClassifyVO;
import com.pcloud.book.group.vo.ListBookGroupQrcodeExportParamVO;
import com.pcloud.book.group.vo.ListBookGroupQrcodeParamVO;
import com.pcloud.book.group.vo.ListClassify4WechatVO;
import com.pcloud.book.group.vo.ListClassifyVO;
import com.pcloud.book.group.vo.ListGroupClassifyParam;
import com.pcloud.book.group.vo.PcloudBookGroupClassifyVO;
import com.pcloud.book.group.vo.StatisticVO;
import com.pcloud.book.group.vo.UpdateClassifyVO;
import com.pcloud.book.group.vo.UpdateRankVO;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
...@@ -20,8 +38,6 @@ import com.pcloud.common.utils.NumberUtil; ...@@ -20,8 +38,6 @@ import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie; import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -37,6 +53,9 @@ import java.util.ArrayList; ...@@ -37,6 +53,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/** /**
* @author lily * @author lily
* @date 2019/4/16 21:02 * @date 2019/4/16 21:02
...@@ -321,7 +340,11 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade { ...@@ -321,7 +340,11 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "cityCode",required = false) String cityCode @RequestParam(value = "cityCode",required = false) String cityCode
) throws BizException, PermissionException { ) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long rayAgentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
if (null != rayAgentId && rayAgentId > 0) {
agentId = rayAgentId;
}
return new ResponseDto<>(bookGroupClassifyBiz.listGroupClassify4Pcloud(name, proLabelId, depLabelId, purLabelId, return new ResponseDto<>(bookGroupClassifyBiz.listGroupClassify4Pcloud(name, proLabelId, depLabelId, purLabelId,
firstClassifyId, gradeLabelId, subjectLabelId, agentId,adviserId,currentPage, numPerPage,cityCode)); firstClassifyId, gradeLabelId, subjectLabelId, agentId,adviserId,currentPage, numPerPage,cityCode));
} }
...@@ -378,10 +401,11 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade { ...@@ -378,10 +401,11 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
@RequestParam("currentPage") Integer currentPage) throws BizException, @RequestParam("currentPage") Integer currentPage) throws BizException,
PermissionException { PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if (!NumberUtil.isNumber(wechatUserId)) { if (!NumberUtil.isNumber(wechatUserId)) {
throw new PermissionException("wechatUseId为空"); throw new PermissionException("wechatUseId为空");
} }
return new ResponseDto<PageBeanNew<AppletGroupManageDTO>>(groupQrcodeBiz.getLocalGroup(wechatUserId, numPerPage, currentPage)); return new ResponseDto<PageBeanNew<AppletGroupManageDTO>>(groupQrcodeBiz.getLocalGroup(wechatUserId, numPerPage, currentPage, officialAccountsId));
} }
} }
...@@ -1266,4 +1266,27 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -1266,4 +1266,27 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(map); return new ResponseDto<>(map);
} }
@Override
@RequestMapping(value = "listBookGroup4AppletAgent", method = RequestMethod.GET)
public ResponseDto<PageBean> listBookGroup4AppletAgent(
@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "adviserId", required = false) Long adviserId,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException{
Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId", adviserId);
paramMap.put("name", name != null && "".equals(name.trim()) ? null : name);
paramMap.put("joinGroupType", JoinGroupTypeEnum.XIAORUI.getCode());
paramMap.put("agentId", agentId);
PageBean pageBean = bookGroupBiz.listBookGroup4AppletAgent(paramMap, new PageParam(currentPage, numPerPage));
return new ResponseDto<>(pageBean);
}
} }
...@@ -70,7 +70,7 @@ public interface RightsSettingBiz { ...@@ -70,7 +70,7 @@ public interface RightsSettingBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
RightsSettingDto getItemByRightsSettingId4AppletHome(Long rightsSettingId, Long wechatUserId, String rightsType, Integer readType, Long bookId, Long adviserId, Long channelId, Integer currentPage, Integer numPerPage); RightsSettingDto getItemByRightsSettingId4AppletHome(Long rightsSettingId, Long wechatUserId, String rightsType, Integer readType, Long bookId, Long adviserId, Long channelId, Integer currentPage, Integer numPerPage,Long officialAccountsId);
/** /**
* 每周/长期权益查询--小程序 * 每周/长期权益查询--小程序
...@@ -82,7 +82,7 @@ public interface RightsSettingBiz { ...@@ -82,7 +82,7 @@ public interface RightsSettingBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
List<RightsSettingItem> getItemsByRightsSettingId4Applet(Long rightsSettingId, String rightsType, Long wechatUserId, Integer readType, Long bookId, Long adviserId, Long channelId, String cityCode, Integer currentPage, Integer numPerPage); List<RightsSettingItem> getItemsByRightsSettingId4Applet(Long rightsSettingId, String rightsType, Long wechatUserId, Integer readType, Long bookId, Long adviserId, Long channelId, String cityCode, Integer currentPage, Integer numPerPage,Long agentId);
/** /**
* 查所有权益分类 * 查所有权益分类
...@@ -108,12 +108,12 @@ public interface RightsSettingBiz { ...@@ -108,12 +108,12 @@ public interface RightsSettingBiz {
* @Param [rightsSettingId, wechatUserId, type] * @Param [rightsSettingId, wechatUserId, type]
* @return com.pcloud.book.rightsSetting.entity.RightsSetting * @return com.pcloud.book.rightsSetting.entity.RightsSetting
**/ **/
RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type, Long adviserId, Long bookId, Long channelId, Integer readType, Integer currentPage, Integer numPerPage); RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type, Long adviserId, Long bookId, Long channelId, Integer readType, Integer currentPage, Integer numPerPage,Long officialAccountsId);
RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId, Integer readType); RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId, Integer readType);
FillRightsSettingAppletsDTO getFillRightsSettingApplets(Long rightsSettingId, Long wechatUserId, Long rightsClassifyId, FillRightsSettingAppletsDTO getFillRightsSettingApplets(Long rightsSettingId, Long wechatUserId, Long rightsClassifyId,
Integer top, Long bookId); Integer top, Long bookId, Long officialAccountsId);
List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy, Integer readType); List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy, Integer readType);
...@@ -123,7 +123,7 @@ public interface RightsSettingBiz { ...@@ -123,7 +123,7 @@ public interface RightsSettingBiz {
void addRightsNowPic(RightsNowPic rightsNowPic); void addRightsNowPic(RightsNowPic rightsNowPic);
PageBeanNew<RightsNowPic> getRightsNowPics(Integer currentPage, Integer numPerPage, Integer type); PageBeanNew<RightsNowPic> getRightsNowPics(Integer currentPage, Integer numPerPage, Integer type, Long agentId);
void deleteRightsNowPic(Long rightsNowPicId); void deleteRightsNowPic(Long rightsNowPicId);
......
...@@ -23,4 +23,6 @@ public class BaseTempletClassify extends BaseEntity { ...@@ -23,4 +23,6 @@ public class BaseTempletClassify extends BaseEntity {
private Long volLabelId; private Long volLabelId;
@ApiModelProperty("版本标签") @ApiModelProperty("版本标签")
private Long verLabelId; private Long verLabelId;
@ApiModelProperty("agentId")
private Long agentId;
} }
...@@ -24,4 +24,7 @@ public class RightsNowPic extends BaseEntity { ...@@ -24,4 +24,7 @@ public class RightsNowPic extends BaseEntity {
@ApiModelProperty("图片库类型(1立享权益2资讯3书单4书刊分类)") @ApiModelProperty("图片库类型(1立享权益2资讯3书单4书刊分类)")
private Integer type; private Integer type;
@ApiModelProperty("出版社id")
private Long agentId;
} }
\ No newline at end of file
...@@ -150,6 +150,7 @@ public class RightsSetting extends BaseTempletClassify { ...@@ -150,6 +150,7 @@ public class RightsSetting extends BaseTempletClassify {
@ApiModelProperty("上下架状态") @ApiModelProperty("上下架状态")
private Boolean showState; private Boolean showState;
public RightsSetting() { public RightsSetting() {
} }
......
...@@ -31,6 +31,9 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -31,6 +31,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import java.util.List; import java.util.List;
...@@ -136,10 +139,11 @@ public class RightsSettingFacede { ...@@ -136,10 +139,11 @@ public class RightsSettingFacede {
@RequestParam(value = "currentPage",required = false) Integer currentPage, @RequestParam(value = "currentPage",required = false) Integer currentPage,
@RequestParam(value = "numPerPage",required = false) Integer numPerPage) { @RequestParam(value = "numPerPage",required = false) Integer numPerPage) {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if (null == rightsSettingId || StringUtil.isEmpty(rightsType)) { if (null == rightsSettingId || StringUtil.isEmpty(rightsType)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!");
} }
return new ResponseDto<>(rightsSettingBiz.getItemByRightsSettingId4AppletHome(rightsSettingId, wechatUserId, rightsType, readType, bookId, adviserId, channelId, currentPage, numPerPage)); return new ResponseDto<>(rightsSettingBiz.getItemByRightsSettingId4AppletHome(rightsSettingId, wechatUserId, rightsType, readType, bookId, adviserId, channelId, currentPage, numPerPage,officialAccountsId));
} }
@ApiOperation("所有权益分类") @ApiOperation("所有权益分类")
...@@ -178,7 +182,8 @@ public class RightsSettingFacede { ...@@ -178,7 +182,8 @@ public class RightsSettingFacede {
@RequestParam(value = "currentPage", required = false) Integer currentPage @RequestParam(value = "currentPage", required = false) Integer currentPage
) { ) {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType, adviserId, bookId, channelId, readType, currentPage, numPerPage)); Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType, adviserId, bookId, channelId, readType, currentPage, numPerPage,officialAccountsId));
} }
@ApiOperation("根据权益id获取即享权益项专享礼包") @ApiOperation("根据权益id获取即享权益项专享礼包")
...@@ -202,10 +207,11 @@ public class RightsSettingFacede { ...@@ -202,10 +207,11 @@ public class RightsSettingFacede {
@RequestParam("rightsSettingId") Long rightsSettingId @RequestParam("rightsSettingId") Long rightsSettingId
) throws PermissionException { ) throws PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
if (null == rightsSettingId) { if (null == rightsSettingId) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!");
} }
return new ResponseDto<>(rightsSettingBiz.getFillRightsSettingApplets(rightsSettingId, wechatUserId, null, null, null)); return new ResponseDto<>(rightsSettingBiz.getFillRightsSettingApplets(rightsSettingId, wechatUserId, null, null, null, officialAccountsId));
} }
@ApiOperation("根据权益id获取即享权益配套资料分组集合") @ApiOperation("根据权益id获取即享权益配套资料分组集合")
...@@ -253,7 +259,9 @@ public class RightsSettingFacede { ...@@ -253,7 +259,9 @@ public class RightsSettingFacede {
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestBody RightsNowPic rightsNowPic @RequestBody RightsNowPic rightsNowPic
) throws PermissionException { ) throws PermissionException {
SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
rightsNowPic.setAgentId(agentId);
rightsSettingBiz.addRightsNowPic(rightsNowPic); rightsSettingBiz.addRightsNowPic(rightsNowPic);
return new ResponseDto<>(); return new ResponseDto<>();
} }
...@@ -266,8 +274,9 @@ public class RightsSettingFacede { ...@@ -266,8 +274,9 @@ public class RightsSettingFacede {
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "type", required = false) @ApiParam("图片类型(1立享权益2资讯3书单4书刊分类)") Integer type @RequestParam(value = "type", required = false) @ApiParam("图片类型(1立享权益2资讯3书单4书刊分类)") Integer type
) throws PermissionException { ) throws PermissionException {
SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
return new ResponseDto<>(rightsSettingBiz.getRightsNowPics(currentPage,numPerPage,type)); Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(rightsSettingBiz.getRightsNowPics(currentPage,numPerPage,type, agentId));
} }
@ApiOperation("删除即享权益图片") @ApiOperation("删除即享权益图片")
......
...@@ -66,7 +66,7 @@ public interface PcloudGroupActivityBiz { ...@@ -66,7 +66,7 @@ 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 secondClassify,
Long gradeLabelId, Long gradeLabelId,
Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode); Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode, Long agentId);
/** /**
* 获取共读活动列表(弹窗) * 获取共读活动列表(弹窗)
...@@ -76,7 +76,7 @@ public interface PcloudGroupActivityBiz { ...@@ -76,7 +76,7 @@ public interface PcloudGroupActivityBiz {
* @param currentPage * @param currentPage
* @return * @return
*/ */
PageBeanNew<ListGroupActivityResponseVO> listGroupActivity(String name, Integer joinType, Integer numPerPage, Integer currentPage); PageBeanNew<ListGroupActivityResponseVO> listGroupActivity(String name, Integer joinType, Integer numPerPage, Integer currentPage, Long agentId);
/** /**
* 根据分类获取社群共读 * 根据分类获取社群共读
* @return * @return
...@@ -95,7 +95,7 @@ public interface PcloudGroupActivityBiz { ...@@ -95,7 +95,7 @@ public interface PcloudGroupActivityBiz {
* @date:2020/6/8 10:49 * @date:2020/6/8 10:49
* * @param null * * @param null
*/ */
PageBeanNew<AppletGroupManageDTO> getGroupListByBookTemplet(Long wechatUserId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer currentPage, Integer numPerPage); PageBeanNew<AppletGroupManageDTO> getGroupListByBookTemplet(Long wechatUserId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer currentPage, Integer numPerPage, Long agentId);
List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit); List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit);
...@@ -105,7 +105,9 @@ public interface PcloudGroupActivityBiz { ...@@ -105,7 +105,9 @@ public interface PcloudGroupActivityBiz {
Map<Long, GroupActivity4AppletDTO> getByIds4Now(List<Long> groupIds); Map<Long, GroupActivity4AppletDTO> getByIds4Now(List<Long> groupIds);
PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage); PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage, Long officialAccountsId);
void updateMediaId(PcloudGroupActivity pcloudGroupActivity); void updateMediaId(PcloudGroupActivity pcloudGroupActivity);
QueryGroupActivityResponseVO getByActivityId(Long id);
} }
...@@ -6,6 +6,7 @@ import com.google.common.collect.Maps; ...@@ -6,6 +6,7 @@ import com.google.common.collect.Maps;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO; import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz; import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz;
import com.pcloud.book.applet.dao.AppletLinkClickDao; import com.pcloud.book.applet.dao.AppletLinkClickDao;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dto.AppletGroupManageDTO; import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.applet.dto.AppletGroupStatementDTO; import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
...@@ -65,9 +66,12 @@ import com.pcloud.usercenter.party.agent.service.AgentService; ...@@ -65,9 +66,12 @@ import com.pcloud.usercenter.party.agent.service.AgentService;
import com.sdk.wxgroup.RobotProcessTypeEnum; import com.sdk.wxgroup.RobotProcessTypeEnum;
import com.sdk.wxgroup.SendGroupInviteVO; import com.sdk.wxgroup.SendGroupInviteVO;
import com.sdk.wxgroup.SendPicMessageVO; import com.sdk.wxgroup.SendPicMessageVO;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -135,6 +139,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -135,6 +139,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Autowired @Autowired
private BookGroupBiz bookGroupBiz; private BookGroupBiz bookGroupBiz;
@Autowired @Autowired
private AppletNewsBiz appletNewsBiz;
@Autowired
private AppletLinkClickDao appletLinkClickDao; private AppletLinkClickDao appletLinkClickDao;
@ParamLog("批量分类") @ParamLog("批量分类")
...@@ -172,9 +178,12 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -172,9 +178,12 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@ParamLog("保存共读活动") @ParamLog("保存共读活动")
@Override @Override
public void saveGroupActivity(SaveGroupActivityRequestVO vo) { public void saveGroupActivity(SaveGroupActivityRequestVO vo) {
if (null == vo.getAgentId()){
vo.setAgentId(0L);
}
//校验编号是否重复 //校验编号是否重复
if(!StringUtil.isEmpty(vo.getNumber())){ if(!StringUtil.isEmpty(vo.getNumber())){
Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber()); Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber(),vo.getAgentId());
if (count>0){ if (count>0){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"参数有误,编号已存在!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR,"参数有误,编号已存在!");
} }
...@@ -188,6 +197,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -188,6 +197,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
entity.setUpdateUser(vo.getUserId()); entity.setUpdateUser(vo.getUserId());
entity.setUpdateTime(now); entity.setUpdateTime(now);
entity.setIsDelete(0); entity.setIsDelete(0);
entity.setAgentId(vo.getAgentId());
rightsSettingBiz.setClassifyAndLabel(entity); rightsSettingBiz.setClassifyAndLabel(entity);
pcloudGroupActivityDao.insert(entity); pcloudGroupActivityDao.insert(entity);
...@@ -204,7 +214,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -204,7 +214,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
//校验编号是否重复 //校验编号是否重复
if(!StringUtil.isEmpty(vo.getNumber())){ if(!StringUtil.isEmpty(vo.getNumber())){
Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber()); Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber(),activity.getAgentId());
if (count > 0 && (!vo.getNumber().equals(activity.getNumber()))) { if (count > 0 && (!vo.getNumber().equals(activity.getNumber()))) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误,编号已存在!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误,编号已存在!");
} }
...@@ -286,7 +296,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -286,7 +296,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
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 secondClassify,
Long gradeLabelId, Long gradeLabelId,
Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode) { Long subjectLabelId, Integer numPerPage, Integer currentPage, String cityCode,Long agentId) {
PageParam pageParam = new PageParam(currentPage, numPerPage); PageParam pageParam = new PageParam(currentPage, numPerPage);
BaseTempletClassify baseTempletClassify =new BaseTempletClassify(); BaseTempletClassify baseTempletClassify =new BaseTempletClassify();
...@@ -308,6 +318,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -308,6 +318,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
paraMap.put("gradeLabelId", baseTempletClassify.getGradeLabelId()); paraMap.put("gradeLabelId", baseTempletClassify.getGradeLabelId());
paraMap.put("subjectLabelId", baseTempletClassify.getSubjectLabelId()); paraMap.put("subjectLabelId", baseTempletClassify.getSubjectLabelId());
paraMap.put("cityCode", cityCode); paraMap.put("cityCode", cityCode);
paraMap.put("agentId", agentId);
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;
...@@ -414,7 +425,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -414,7 +425,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
} }
@Override @Override
public PageBeanNew<ListGroupActivityResponseVO> listGroupActivity(String name, Integer joinType, Integer numPerPage, Integer currentPage) { public PageBeanNew<ListGroupActivityResponseVO> listGroupActivity(String name, Integer joinType, Integer numPerPage, Integer currentPage,Long agentId) {
PageParam pageParam = new PageParam(currentPage, numPerPage); PageParam pageParam = new PageParam(currentPage, numPerPage);
// 根据数命查bookid // 根据数命查bookid
List<Long> bookIds = new ArrayList<>(); List<Long> bookIds = new ArrayList<>();
...@@ -425,6 +436,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -425,6 +436,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
paraMap.put("name", StringUtil.isEmpty(name) ? null : name); paraMap.put("name", StringUtil.isEmpty(name) ? null : name);
paraMap.put("bookIds", bookIds); paraMap.put("bookIds", bookIds);
paraMap.put("joinType", joinType); paraMap.put("joinType", joinType);
paraMap.put("agentId", agentId);
PageBeanNew<ListGroupActivityResponseVO> listGroupActivity = pcloudGroupActivityDao.listPageNew(pageParam, paraMap, "listGroupActivity"); PageBeanNew<ListGroupActivityResponseVO> listGroupActivity = pcloudGroupActivityDao.listPageNew(pageParam, paraMap, "listGroupActivity");
if (null == listGroupActivity || CollectionUtils.isEmpty(listGroupActivity.getRecordList())) { if (null == listGroupActivity || CollectionUtils.isEmpty(listGroupActivity.getRecordList())) {
return listGroupActivity; return listGroupActivity;
...@@ -545,7 +557,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -545,7 +557,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
} }
@Override @Override
public PageBeanNew<AppletGroupManageDTO> getGroupListByBookTemplet(Long wechatUserId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer currentPage, Integer numPerPage) { public PageBeanNew<AppletGroupManageDTO> getGroupListByBookTemplet(Long wechatUserId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer currentPage, Integer numPerPage, Long agentId) {
// 处理分类和标签 // 处理分类和标签
if (null == firstClassify && null == secondClassify && null == gradeLabelId && null == subjectLabelId) { if (null == firstClassify && null == secondClassify && null == gradeLabelId && null == subjectLabelId) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
...@@ -561,6 +573,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -561,6 +573,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
map.put("secondClassify", baseTempletClassify.getSecondClassify()); map.put("secondClassify", baseTempletClassify.getSecondClassify());
map.put("gradeLabelId", baseTempletClassify.getGradeLabelId()); map.put("gradeLabelId", baseTempletClassify.getGradeLabelId());
map.put("subjectLabelId", baseTempletClassify.getSubjectLabelId()); map.put("subjectLabelId", baseTempletClassify.getSubjectLabelId());
map.put("agentId", agentId);
PageBeanNew<AppletGroupManageDTO> list = pcloudGroupActivityDao.listPageNew(new PageParam(currentPage,numPerPage),map,"getGroupListByBookTemplet"); PageBeanNew<AppletGroupManageDTO> list = pcloudGroupActivityDao.listPageNew(new PageParam(currentPage,numPerPage),map,"getGroupListByBookTemplet");
if (null == list || ListUtils.isEmpty(list.getRecordList())) { if (null == list || ListUtils.isEmpty(list.getRecordList())) {
return new PageBeanNew<>(currentPage,numPerPage,0,new ArrayList<>()); return new PageBeanNew<>(currentPage,numPerPage,0,new ArrayList<>());
...@@ -656,13 +669,15 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -656,13 +669,15 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override @Override
public PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage) { public PageBeanNew<AppletGroupManageDTO> getLocalGroup(Long wechatUserId, Integer numPerPage, Integer currentPage, Long officialAccountsId) {
String cityCode = readerConsr.getCityCodeByWechatUserId(wechatUserId); String cityCode = readerConsr.getCityCodeByWechatUserId(wechatUserId);
if (StringUtil.isEmpty(cityCode)) { if (StringUtil.isEmpty(cityCode)) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
Long agentId = appletNewsBiz.getAgentIdByAccountId(officialAccountsId);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("cityCode", cityCode); map.put("cityCode", cityCode);
map.put("agentId", agentId);
PageBeanNew<AppletGroupManageDTO> pageBeanNew = pcloudGroupActivityDao PageBeanNew<AppletGroupManageDTO> pageBeanNew = pcloudGroupActivityDao
.listPageNew(new PageParam(currentPage, numPerPage), map, "getLocalGroup"); .listPageNew(new PageParam(currentPage, numPerPage), map, "getLocalGroup");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
...@@ -697,4 +712,23 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -697,4 +712,23 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
public void updateMediaId(PcloudGroupActivity pcloudGroupActivity) { public void updateMediaId(PcloudGroupActivity pcloudGroupActivity) {
pcloudGroupActivityDao.updateByPrimaryKeySelective(pcloudGroupActivity); pcloudGroupActivityDao.updateByPrimaryKeySelective(pcloudGroupActivity);
} }
@Override
public QueryGroupActivityResponseVO getByActivityId(Long id) {
QueryGroupActivityResponseVO responseVO = pcloudGroupActivityDao.getByActivityId(id);
// 组装标签名称
List<Long> labelId = Lists.newArrayList();
labelId.add(responseVO.getProLabelId());
labelId.add(responseVO.getPurLabelId());
labelId.add(responseVO.getDepLabelId());
Map<Long, String> labelName = labelConsr.getLabelName(labelId);
if (!MapUtils.isEmpty(labelName)){
responseVO.setPurLabelName(labelName.get(responseVO.getPurLabelId()));
responseVO.setProLabelName(labelName.get(responseVO.getProLabelId()));
responseVO.setDepLabelName(labelName.get(responseVO.getDepLabelId()));
}
//设置分类名称
setLabelContent(Arrays.asList(responseVO));
return responseVO;
}
} }
...@@ -5,6 +5,7 @@ import com.pcloud.book.skill.dto.GroupActivity4AppletDTO; ...@@ -5,6 +5,7 @@ import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity; import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO; import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO; import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
import java.util.List; import java.util.List;
...@@ -12,7 +13,7 @@ import java.util.Map; ...@@ -12,7 +13,7 @@ import java.util.Map;
public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> { public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> {
Integer getCountByNumber(String number); Integer getCountByNumber(String number, Long agentId);
void batchUpdateShowState(GroupActivityClassifyVO groupActivityClassifyVO); void batchUpdateShowState(GroupActivityClassifyVO groupActivityClassifyVO);
...@@ -38,4 +39,5 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> { ...@@ -38,4 +39,5 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> {
PcloudGroupActivity getById(Long id); PcloudGroupActivity getById(Long id);
QueryGroupActivityResponseVO getByActivityId(Long id);
} }
...@@ -6,6 +6,7 @@ import com.pcloud.book.skill.dto.GroupActivity4AppletDTO; ...@@ -6,6 +6,7 @@ import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity; import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO; import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO; import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
import com.pcloud.common.core.dao.BaseDaoImpl; import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -18,8 +19,11 @@ import java.util.Map; ...@@ -18,8 +19,11 @@ import java.util.Map;
public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> implements PcloudGroupActivityDao { public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> implements PcloudGroupActivityDao {
@Override @Override
public Integer getCountByNumber(String number){ public Integer getCountByNumber(String number, Long agentId){
return getSessionTemplate().selectOne(getStatement("getCountByNumber"), number); Map<String,Object> map = new HashMap<>();
map.put("number", number);
map.put("agentId", agentId);
return getSessionTemplate().selectOne(getStatement("getCountByNumber"), map);
} }
@Override @Override
...@@ -74,6 +78,7 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> ...@@ -74,6 +78,7 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity>
map.put("gradeLabelId", baseTempletClassify.getGradeLabelId()); map.put("gradeLabelId", baseTempletClassify.getGradeLabelId());
map.put("subjectLabelId", baseTempletClassify.getSubjectLabelId()); map.put("subjectLabelId", baseTempletClassify.getSubjectLabelId());
map.put("limit", (limit != null ? limit :10)); map.put("limit", (limit != null ? limit :10));
map.put("agentId",baseTempletClassify.getAgentId()==null?0L:baseTempletClassify.getAgentId());
return super.getSqlSession().selectList(getStatement("getTishBookSchoolList"), map); return super.getSqlSession().selectList(getStatement("getTishBookSchoolList"), map);
} }
...@@ -105,6 +110,10 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> ...@@ -105,6 +110,10 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity>
return super.getSqlSession().selectOne(getStatement("getById"),id); return super.getSqlSession().selectOne(getStatement("getById"),id);
} }
@Override
public QueryGroupActivityResponseVO getByActivityId(Long id) {
return getSessionTemplate().selectOne(getStatement("getByActivityId"), id);
}
} }
...@@ -2,6 +2,9 @@ package com.pcloud.book.skill.entity; ...@@ -2,6 +2,9 @@ package com.pcloud.book.skill.entity;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify; import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import lombok.Data;
@Data
public class PcloudGroupActivity extends BaseTempletClassify { public class PcloudGroupActivity extends BaseTempletClassify {
private static final long serialVersionUID = -2579070770051745966L; private static final long serialVersionUID = -2579070770051745966L;
...@@ -40,139 +43,6 @@ public class PcloudGroupActivity extends BaseTempletClassify { ...@@ -40,139 +43,6 @@ public class PcloudGroupActivity extends BaseTempletClassify {
//微信素材id //微信素材id
private String mediaId; private String mediaId;
public String getMediaId() { private Long agentId;
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public Integer getIsShow() {
return isShow;
}
public void setIsShow(Integer isShow) {
this.isShow = isShow;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getGroupPic() {
return groupPic;
}
public void setGroupPic(String groupPic) {
this.groupPic = groupPic;
}
public Integer getJoinType() {
return joinType;
}
public void setJoinType(Integer joinType) {
this.joinType = joinType;
}
public Long getProLabelId() {
return proLabelId;
}
public void setProLabelId(Long proLabelId) {
this.proLabelId = proLabelId;
}
public Long getDepLabelId() {
return depLabelId;
}
public void setDepLabelId(Long depLabelId) {
this.depLabelId = depLabelId;
}
public Long getPurLabelId() {
return purLabelId;
}
public void setPurLabelId(Long purLabelId) {
this.purLabelId = purLabelId;
}
public Long getBookGroupClassifyId() {
return bookGroupClassifyId;
}
public void setBookGroupClassifyId(Long bookGroupClassifyId) {
this.bookGroupClassifyId = bookGroupClassifyId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getGroupExtLink() {
return groupExtLink;
}
public void setGroupExtLink(String groupExtLink) {
this.groupExtLink = groupExtLink;
}
public Integer getGroupType() {
return groupType;
}
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
} }
\ No newline at end of file
...@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
...@@ -71,7 +72,10 @@ public class PcloudGroupActivityFacade { ...@@ -71,7 +72,10 @@ public class PcloudGroupActivityFacade {
@PostMapping("saveGroupActivity") @PostMapping("saveGroupActivity")
public ResponseDto<Void> saveGroupActivity(@RequestHeader("token") String token, @RequestBody SaveGroupActivityRequestVO vo) throws PermissionException { public ResponseDto<Void> saveGroupActivity(@RequestHeader("token") String token, @RequestBody SaveGroupActivityRequestVO vo) throws PermissionException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
vo.setAgentId(agentId);
vo.setUserId(partyId); vo.setUserId(partyId);
pcloudGroupActivityBiz.saveGroupActivity(vo); pcloudGroupActivityBiz.saveGroupActivity(vo);
return new ResponseDto<>(); return new ResponseDto<>();
...@@ -93,7 +97,8 @@ public class PcloudGroupActivityFacade { ...@@ -93,7 +97,8 @@ public class PcloudGroupActivityFacade {
} }
@GetMapping("queryGroupActivity") @GetMapping("queryGroupActivity")
public ResponseDto<PageBeanNew<QueryGroupActivityResponseVO>> queryGroupActivity(@RequestParam(value = "name", required = false) String name, public ResponseDto<PageBeanNew<QueryGroupActivityResponseVO>> queryGroupActivity(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId,
...@@ -105,16 +110,21 @@ public class PcloudGroupActivityFacade { ...@@ -105,16 +110,21 @@ 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){
return new ResponseDto<>(pcloudGroupActivityBiz.queryGroupActivity(name, proLabelId, purLabelId, depLabelId, joinType,firstClassify,secondClassify, gradeLabelId,subjectLabelId,numPerPage, currentPage, cityCode)); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(pcloudGroupActivityBiz.queryGroupActivity(name, proLabelId, purLabelId, depLabelId, joinType,firstClassify,secondClassify, gradeLabelId,subjectLabelId,numPerPage, currentPage,cityCode, agentId));
} }
@ApiOperation("获取共读活动列表(弹窗)") @ApiOperation("获取共读活动列表(弹窗)")
@GetMapping("listGroupActivity") @GetMapping("listGroupActivity")
public ResponseDto<PageBeanNew<ListGroupActivityResponseVO>> listGroupActivity(@RequestParam(value = "name", required = false) String name, public ResponseDto<PageBeanNew<ListGroupActivityResponseVO>> listGroupActivity(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "joinType", required = false) Integer joinType, @RequestParam(value = "joinType", required = false) Integer joinType,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam("currentPage") Integer currentPage){ @RequestParam("currentPage") Integer currentPage){
return new ResponseDto<>(pcloudGroupActivityBiz.listGroupActivity(name, joinType, numPerPage, currentPage)); Map<String, Object> map = SessionUtil.getToken4Redis(token);
Long agentId = (Long) map.get(SessionUtil.RAY_AGENT_ID);
return new ResponseDto<>(pcloudGroupActivityBiz.listGroupActivity(name, joinType, numPerPage, currentPage, agentId));
} }
@PostMapping("updateActivityShowState") @PostMapping("updateActivityShowState")
...@@ -124,4 +134,11 @@ public class PcloudGroupActivityFacade { ...@@ -124,4 +134,11 @@ public class PcloudGroupActivityFacade {
return new ResponseDto<>(); return new ResponseDto<>();
} }
@ApiOperation("根据id查询")
@GetMapping("getByActivityId")
public ResponseDto<?> getByActivityId(@RequestHeader("token") String token, @RequestParam("id") Long id){
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(pcloudGroupActivityBiz.getByActivityId(id));
}
} }
...@@ -55,6 +55,9 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify { ...@@ -55,6 +55,9 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
@ApiModelProperty("群分类id") @ApiModelProperty("群分类id")
private Long bookGroupClassifyId; private Long bookGroupClassifyId;
@ApiModelProperty("出版社id")
private Long agentId;
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()
......
...@@ -38,6 +38,11 @@ public class BookProps { ...@@ -38,6 +38,11 @@ public class BookProps {
private static String wechatDomain; private static String wechatDomain;
/**
* 小程序公众号id 777
*/
private static Long miniOfficialAccountsId;
public static String getJisuAppKey() { public static String getJisuAppKey() {
return jisuAppKey; return jisuAppKey;
} }
...@@ -123,4 +128,13 @@ public class BookProps { ...@@ -123,4 +128,13 @@ public class BookProps {
public void setHealsAdviserId(Long healsAdviserId) { public void setHealsAdviserId(Long healsAdviserId) {
BookProps.healsAdviserId = healsAdviserId; BookProps.healsAdviserId = healsAdviserId;
} }
public static Long getMiniOfficialAccountsId() {
return miniOfficialAccountsId;
}
@Value("${mini.official.account.id}")
public void setMiniOfficialAccountsId(Long miniOfficialAccountsId) {
BookProps.miniOfficialAccountsId = miniOfficialAccountsId;
}
} }
...@@ -10,18 +10,19 @@ ...@@ -10,18 +10,19 @@
<result column="show_state" property="showState" jdbcType="BOOLEAN" /> <result column="show_state" property="showState" jdbcType="BOOLEAN" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, banner_pic, jump_type, jump_url, seq, show_state, create_time, update_time id, banner_pic, jump_type, jump_url, seq, show_state, create_time, update_time, agent_id
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletBanner" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletBanner" useGeneratedKeys="true" keyProperty="id">
insert into applet_banner( insert into applet_banner(
banner_pic, jump_type, jump_url, seq, show_state, create_time, update_time banner_pic, jump_type, jump_url, seq, show_state, create_time, update_time, agent_id
) )
values ( values (
#{bannerPic}, #{jumpType}, #{jumpUrl}, #{seq}, #{showState}, NOW(), NOW() #{bannerPic}, #{jumpType}, #{jumpUrl}, #{seq}, #{showState}, NOW(), NOW(), #{agentId}
) )
</insert> </insert>
...@@ -72,11 +73,20 @@ ...@@ -72,11 +73,20 @@
<if test="showState != null"> <if test="showState != null">
and show_state = #{showState} and show_state = #{showState}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
ORDER BY seq ASC ORDER BY seq ASC
</select> </select>
<select id="getMaxSeq" resultType="Integer"> <select id="getMaxSeq" resultType="Integer" parameterType="map">
SELECT IFNULL(MAX(seq),0) FROM applet_banner SELECT IFNULL(MAX(seq),0) FROM applet_banner
WHERE agent_id = #{agentId}
</select> </select>
</mapper> </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.applet.dao.impl.AppletBookClassifyAgentDaoImpl">
<resultMap type="com.pcloud.book.applet.entity.AppletBookClassifyAgent" id="AppletBookClassifyAgentMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="appletBookClassifyId" column="applet_book_classify_id" jdbcType="INTEGER"/>
<result property="agentId" column="agent_id" jdbcType="INTEGER"/>
<result property="showState" column="show_state" jdbcType="BOOLEAN"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="classifyName" column="classify_name" jdbcType="VARCHAR"/>
<result property="seq" column="seq" jdbcType="INTEGER"/>
<result property="pic" column="pic" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List" >
id, applet_book_classify_id, agent_id, show_state, create_time, update_time, classify_name,seq,pic
</sql>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.applet_book_classify_agent(applet_book_classify_id, agent_id, show_state, create_time, update_time, classify_name,seq, pic)
values (#{appletBookClassifyId}, #{agentId}, #{showState}, NOW(), NOW(), #{classifyName}, #{seq}, #{pic})
</insert>
<!--批量新增-->
<insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List">
insert into book.applet_book_classify_agent(applet_book_classify_id, agent_id, show_state, create_time, update_time, classify_name, seq, pic)
values
<foreach collection="list" item="item" index="index" separator="," >
(
#{item.appletBookClassifyId,jdbcType=INTEGER},
#{item.agentId,jdbcType=INTEGER},
#{item.showState},
NOW(),
NOW(),
#{item.classifyName},
#{item.seq},
#{item.pic}
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="updateBaseInfoByAgent" parameterType="com.pcloud.book.applet.entity.AppletBookClassifyAgent">
update book.applet_book_classify_agent
<set>
<if test="classifyName != null and classifyName != ''">
classify_name = #{classifyName},
</if>
<if test="seq != null">
seq = #{seq},
</if>
<if test="pic != null and pic != ''">
pic = #{pic},
</if>
<if test="showState != null">
show_state = #{showState},
</if>
update_time = now(),
</set>
where
applet_book_classify_id = #{appletBookClassifyId}
and agent_id = #{agentId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from book.applet_book_classify_agent where id = #{id}
</delete>
<select id="getByAgent" parameterType="long" resultMap="AppletBookClassifyAgentMap">
SELECT <include refid="Base_Column_List"/>
FROM applet_book_classify_agent
WHERE agent_id = #{agentId}
</select>
<select id="listClassifyByAgent" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletBookClassifyDTO">
select
c.id, c.classify, a.classify_name classifyName, a.seq, a.pic, a.show_state showState
from applet_book_classify c
LEFT JOIN applet_book_classify_agent a ON c.id = a.applet_book_classify_id
WHERE
a.agent_id = #{agentId}
<if test="showState != null">
AND a.show_state = #{showState}
</if>
order by a.seq asc, a.id asc
</select>
</mapper>
\ No newline at end of file
...@@ -106,6 +106,14 @@ ...@@ -106,6 +106,14 @@
<if test="classifyId >0"> <if test="classifyId >0">
AND b.classify_id= #{classifyId} AND b.classify_id= #{classifyId}
</if> </if>
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
GROUP BY b.id GROUP BY b.id
order by b.create_time desc order by b.create_time desc
</select> </select>
......
...@@ -9,19 +9,19 @@ ...@@ -9,19 +9,19 @@
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="pic" property="pic" jdbcType="VARCHAR" /> <result column="pic" property="pic" jdbcType="VARCHAR" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, classify_name, seq, show_state, create_time,update_time,pic id, classify_name, seq, show_state, create_time,update_time,pic, agent_id
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletBooklistClassify" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletBooklistClassify" useGeneratedKeys="true" keyProperty="id">
insert into applet_booklist_classify ( insert into applet_booklist_classify (
classify_name, seq, show_state, create_time, update_time, pic classify_name, seq, show_state, create_time, update_time, pic, agent_id
) )
values ( values (
#{classifyName}, #{seq}, #{showState}, NOW(), NOW(), #{pic} #{classifyName}, #{seq}, #{showState}, NOW(), NOW(), #{pic}, #{agentId}
) )
</insert> </insert>
...@@ -70,13 +70,22 @@ ...@@ -70,13 +70,22 @@
<if test="name != null"> <if test="name != null">
AND b.classify_name LIKE CONCAT("%",#{name},"%") AND b.classify_name LIKE CONCAT("%",#{name},"%")
</if> </if>
<choose>
<when test="agentId != null">
and b.agent_id = #{agentId}
</when>
<otherwise>
and b.agent_id = 0
</otherwise>
</choose>
GROUP BY b.id GROUP BY b.id
order by b.seq asc order by b.seq asc
</select> </select>
<select id="getMaxSeq" resultType="Integer"> <select id="getMaxSeq" resultType="Integer" parameterType="map">
SELECT IFNULL(MAX(seq),0) FROM applet_booklist_classify SELECT IFNULL(MAX(seq),0) FROM applet_booklist_classify
WHERE agent_id = #{agentId}
</select> </select>
<select id="getAllBooklistClassify" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletBooklistClassifyDTO"> <select id="getAllBooklistClassify" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletBooklistClassifyDTO">
...@@ -87,6 +96,14 @@ ...@@ -87,6 +96,14 @@
<if test="showState != null"> <if test="showState != null">
AND show_state = #{showState} AND show_state = #{showState}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
ORDER BY seq ASC, id asc ORDER BY seq ASC, id asc
</select> </select>
......
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
<result column="recommend" property="recommend" jdbcType="INTEGER"/> <result column="recommend" property="recommend" jdbcType="INTEGER"/>
<result column="seq_num" property="seqNum" jdbcType="INTEGER"/> <result column="seq_num" property="seqNum" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, group_activity_id, enable, recommend, seq_num, create_time id, group_activity_id, enable, recommend, seq_num, create_time, agent_id
</sql> </sql>
<select id="getById" resultMap="BaseResultMap"> <select id="getById" resultMap="BaseResultMap">
...@@ -50,6 +51,14 @@ ...@@ -50,6 +51,14 @@
<if test="recommend!=null"> <if test="recommend!=null">
AND a.recommend=#{recommend} AND a.recommend=#{recommend}
</if> </if>
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
ORDER BY a.seq_num, a.id DESC ORDER BY a.seq_num, a.id DESC
</select> </select>
...@@ -79,6 +88,14 @@ ...@@ -79,6 +88,14 @@
<if test="name!=null"> <if test="name!=null">
AND b.name like concat('%',#{name},'%') AND b.name like concat('%',#{name},'%')
</if> </if>
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
ORDER BY a.id DESC ORDER BY a.id DESC
</select> </select>
...@@ -86,6 +103,7 @@ ...@@ -86,6 +103,7 @@
SELECT SELECT
IFNULL(MAX(seq_num), 0) IFNULL(MAX(seq_num), 0)
FROM applet_group_manage FROM applet_group_manage
WHERE agent_id = #{agentId}
</select> </select>
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
...@@ -94,13 +112,15 @@ ...@@ -94,13 +112,15 @@
enable, enable,
recommend, recommend,
seq_num, seq_num,
create_time create_time,
agent_id
) VALUES ( ) VALUES (
#{groupActivityId, jdbcType=BIGINT}, #{groupActivityId, jdbcType=BIGINT},
#{enable, jdbcType=INTEGER}, #{enable, jdbcType=INTEGER},
#{recommend, jdbcType=INTEGER}, #{recommend, jdbcType=INTEGER},
#{seqNum, jdbcType=INTEGER}, #{seqNum, jdbcType=INTEGER},
NOW() NOW(),
#{agentId}
) )
</insert> </insert>
...@@ -110,7 +130,8 @@ ...@@ -110,7 +130,8 @@
enable, enable,
recommend, recommend,
seq_num, seq_num,
create_time create_time,
agent_id
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -118,7 +139,8 @@ ...@@ -118,7 +139,8 @@
#{item.enable, jdbcType=INTEGER}, #{item.enable, jdbcType=INTEGER},
#{item.recommend, jdbcType=INTEGER}, #{item.recommend, jdbcType=INTEGER},
#{item.seqNum, jdbcType=INTEGER}, #{item.seqNum, jdbcType=INTEGER},
NOW() NOW(),
#{item.agentId, jdbcType=BIGINT}
) )
</foreach> </foreach>
</insert> </insert>
......
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
<result column="business_card_type" property="businessCardType" jdbcType="TINYINT" /> <result column="business_card_type" property="businessCardType" jdbcType="TINYINT" />
<result column="business_card_isOpen" property="businessCardIsOpen" jdbcType="TINYINT" /> <result column="business_card_isOpen" property="businessCardIsOpen" jdbcType="TINYINT" />
<result column="city_code" property="cityCode" jdbcType="VARCHAR" /> <result column="city_code" property="cityCode" jdbcType="VARCHAR" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
news.id, news.news_name, news.source, news.news_classify_id, news.pro_label_id, news.dep_label_id, news.pur_label_id, news.type, news.digest, news.id, news.news_name, news.source, news.news_classify_id, news.pro_label_id, news.dep_label_id, news.pur_label_id, news.type, news.digest,
pic1, pic2, pic3, news.content, show_state, news.create_time, news.update_time, news.first_classify, news.second_classify, news.grade_label_id, news.subject_label_id, news.rights_classify_id, pic1, pic2, pic3, news.content, show_state, news.create_time, news.update_time, news.first_classify, news.second_classify, news.grade_label_id, news.subject_label_id, news.rights_classify_id,
news.jump_type, news.jump_url, news.url_number, news.custom_tag_id, news.show_source, news.show_link,news.business_card_id,news.business_card_type,news.business_card_isOpen,city_code news.jump_type, news.jump_url, news.url_number, news.custom_tag_id, news.show_source, news.show_link,news.business_card_id,news.business_card_type,news.business_card_isOpen,city_code,agent_id
</sql> </sql>
<sql id="sql_news"> <sql id="sql_news">
m.id, m.id,
...@@ -73,13 +74,13 @@ ...@@ -73,13 +74,13 @@
insert into applet_news( insert into applet_news(
news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest, news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id, pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url,url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen,city_code jump_type, jump_url,url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen,city_code, agent_id
) )
values ( values (
#{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest}, #{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest},
#{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT}, #{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT}, #{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT},
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink}, #{businessCardId}, #{businessCardType}, #{businessCardIsOpen}, #{cityCode} #{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink}, #{businessCardId}, #{businessCardType}, #{businessCardIsOpen}, #{cityCode}, #{agentId}
) )
</insert> </insert>
...@@ -259,6 +260,14 @@ ...@@ -259,6 +260,14 @@
<if test="customTagId != null"> <if test="customTagId != null">
AND n.custom_tag_id = #{customTagId} AND n.custom_tag_id = #{customTagId}
</if> </if>
<choose>
<when test="agentId != null">
and n.agent_id = #{agentId}
</when>
<otherwise>
and n.agent_id = 0
</otherwise>
</choose>
<if test="classifySelect == 1"> <if test="classifySelect == 1">
<if test="firstClassify!=null"> <if test="firstClassify!=null">
AND category.first_classify =#{firstClassify} AND category.first_classify =#{firstClassify}
...@@ -340,10 +349,19 @@ ...@@ -340,10 +349,19 @@
AND rights_type = #{rightsType} AND rights_type = #{rightsType}
</if> </if>
) )
<choose>
<when test="agentId >0">
and n.agent_id in (#{agentId} ,0)
</when>
<otherwise>
and n.agent_id = 0
</otherwise>
</choose>
group by n.id group by n.id
ORDER BY n.update_time DESC ORDER BY n.agent_id desc, n.create_time DESC
</select> </select>
<select id="getByTempletAndClassify" parameterType="map" resultMap="BaseResultMap"> <select id="getByTempletAndClassify" parameterType="map" resultMap="BaseResultMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -367,9 +385,16 @@ ...@@ -367,9 +385,16 @@
<if test="rightsClassifyId!=null"> <if test="rightsClassifyId!=null">
AND news.rights_classify_id =#{rightsClassifyId} AND news.rights_classify_id =#{rightsClassifyId}
</if> </if>
<choose>
<when test="agentId >0">
and news.agent_id in (#{agentId} ,0)
</when>
<otherwise>
and news.agent_id = 0
</otherwise>
</choose>
group by news.id group by news.id
ORDER BY ORDER BY news.agent_id desc, news.update_time DESC
news.update_time DESC
LIMIT #{top} LIMIT #{top}
</select> </select>
...@@ -418,34 +443,62 @@ ...@@ -418,34 +443,62 @@
</foreach> </foreach>
</delete> </delete>
<select id="insertSource" parameterType="string" resultType="int"> <insert id="insertSource" parameterType="map">
INSERT INTO applet_news_source (source) VALUES (#{source}) INSERT INTO applet_news_source (source, agent_id, create_time) VALUES (#{source}, #{agentId}, now())
</select> </insert>
<select id="getNewsSourceList" resultType="string"> <select id="getNewsSourceList" resultType="string" parameterType="map">
SELECT source FROM applet_news_source SELECT source FROM applet_news_source
WHERE 1=1
<choose>
<when test="agentId != null">
AND agent_id = #{agentId}
</when>
<otherwise>
AND agent_id = 0
</otherwise>
</choose>
</select> </select>
<select id="getAppletNewsSourceCount" resultType="integer" parameterType="string"> <select id="getAppletNewsSourceCount" resultType="integer" parameterType="map">
SELECT COUNT(1) FROM applet_news WHERE source = #{source} SELECT COUNT(1) FROM applet_news
WHERE source = #{source}
<choose>
<when test="agentId != null">
AND agent_id = #{agentId}
</when>
<otherwise>
AND agent_id = 0
</otherwise>
</choose>
</select> </select>
<delete id="deleteSource" parameterType="string"> <delete id="deleteSource" parameterType="map">
DELETE FROM applet_news_source WHERE source = #{source} DELETE FROM applet_news_source WHERE source = #{source} and agent_id = #{agentId}
</delete> </delete>
<select id="newsSourceExist" parameterType="string" resultType="boolean"> <select id="newsSourceExist" parameterType="map" resultType="boolean">
SELECT EXISTS( SELECT EXISTS(
SELECT id FROM applet_news_source WHERE source=#{source} SELECT id FROM applet_news_source
WHERE source=#{source}
<choose>
<when test="agentId != null">
AND agent_id = #{agentId}
</when>
<otherwise>
AND agent_id = 0
</otherwise>
</choose>
) )
</select> </select>
<select id="getUrlNumberByJumpUrl" parameterType="string" resultType="string"> <select id="getUrlNumberByJumpUrl" parameterType="map" resultType="string">
SELECT url_number SELECT url_number
FROM applet_news FROM applet_news
WHERE jump_url = #{jumpUrl} WHERE jump_url = #{jumpUrl}
AND jump_type = 2 AND jump_type = 2
AND url_number IS NOT NULL AND url_number IS NOT NULL
AND agent_id = #{agentId}
LIMIT 1 LIMIT 1
</select> </select>
...@@ -458,6 +511,14 @@ ...@@ -458,6 +511,14 @@
<if test="id>0"> <if test="id>0">
AND id != #{id} AND id != #{id}
</if> </if>
<choose>
<when test="agentId != null">
AND agent_id = #{agentId}
</when>
<otherwise>
AND agent_id = 0
</otherwise>
</choose>
) )
</select> </select>
...@@ -519,6 +580,14 @@ ...@@ -519,6 +580,14 @@
<if test="source!=null"> <if test="source!=null">
AND n.source =#{source} AND n.source =#{source}
</if> </if>
<choose>
<when test="agentId != null">
and n.agent_id = #{agentId}
</when>
<otherwise>
and n.agent_id = 0
</otherwise>
</choose>
group by n.id group by n.id
ORDER BY n.update_time DESC ORDER BY n.update_time DESC
</select> </select>
...@@ -640,7 +709,7 @@ ...@@ -640,7 +709,7 @@
</update> </update>
<insert id="insertCustomTag" parameterType="com.pcloud.book.applet.entity.AppletNewsCustomTag" useGeneratedKeys="true" keyProperty="id"> <insert id="insertCustomTag" parameterType="com.pcloud.book.applet.entity.AppletNewsCustomTag" useGeneratedKeys="true" keyProperty="id">
INSERT INTO applet_news_custom_tag(custom_tag, create_time) VALUES (#{customTag}, now()) INSERT INTO applet_news_custom_tag(custom_tag, create_time, agent_id) VALUES (#{customTag}, now(), #{agentId})
</insert> </insert>
<update id="updateCustomTag" parameterType="com.pcloud.book.applet.entity.AppletNewsCustomTag"> <update id="updateCustomTag" parameterType="com.pcloud.book.applet.entity.AppletNewsCustomTag">
...@@ -648,12 +717,22 @@ ...@@ -648,12 +717,22 @@
where id = #{id} where id = #{id}
</update> </update>
<select id="getCustomTagList" resultType="com.pcloud.book.applet.dto.AppletNewsCustomTagDTO"> <select id="getCustomTagList" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsCustomTagDTO">
SELECT SELECT
id customTagId, id customTagId,
custom_tag customTag custom_tag customTag,
agent_id agentId
FROM FROM
applet_news_custom_tag applet_news_custom_tag
WHERE 1=1
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
ORDER BY ORDER BY
create_time DESC, id DESC create_time DESC, id DESC
</select> </select>
...@@ -664,6 +743,7 @@ ...@@ -664,6 +743,7 @@
FROM applet_news_custom_tag FROM applet_news_custom_tag
WHERE WHERE
custom_tag = #{customTag} custom_tag = #{customTag}
and agent_id = #{agentId}
) )
</select> </select>
......
...@@ -9,18 +9,19 @@ ...@@ -9,18 +9,19 @@
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="pic" property="pic" jdbcType="VARCHAR" /> <result column="pic" property="pic" jdbcType="VARCHAR" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, news_classify, seq, show_state, create_time,update_time, pic id, news_classify, seq, show_state, create_time,update_time, pic, agent_id
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletNewsClassify" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletNewsClassify" useGeneratedKeys="true" keyProperty="id">
insert into applet_news_classify ( insert into applet_news_classify (
news_classify, seq, show_state, create_time, update_time, pic news_classify, seq, show_state, create_time, update_time, pic, agent_id
) )
values ( values (
#{newsClassify}, #{seq}, #{showState}, NOW(), NOW(), #{pic} #{newsClassify}, #{seq}, #{showState}, NOW(), NOW(), #{pic}, #{agentId}
) )
</insert> </insert>
...@@ -69,13 +70,22 @@ ...@@ -69,13 +70,22 @@
<if test="name != null"> <if test="name != null">
AND b.news_classify LIKE CONCAT("%",#{name},"%") AND b.news_classify LIKE CONCAT("%",#{name},"%")
</if> </if>
<choose>
<when test="agentId != null">
and b.agent_id = #{agentId}
</when>
<otherwise>
and b.agent_id = 0
</otherwise>
</choose>
GROUP BY b.id GROUP BY b.id
order by b.seq asc order by b.seq asc,b.id ASC
</select> </select>
<select id="getMaxSeq" resultType="Integer"> <select id="getMaxSeq" resultType="Integer" parameterType="map">
SELECT IFNULL(MAX(seq),0) FROM applet_news_classify SELECT IFNULL(MAX(seq),0) FROM applet_news_classify
WHERE agent_id = #{agentId}
</select> </select>
<select id="getAllNewsClassify" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsClassifyDTO"> <select id="getAllNewsClassify" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsClassifyDTO">
...@@ -86,6 +96,14 @@ ...@@ -86,6 +96,14 @@
<if test="showState != null"> <if test="showState != null">
AND show_state = #{showState} AND show_state = #{showState}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
ORDER BY seq ASC, id asc ORDER BY seq ASC, id asc
</select> </select>
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
<result column="applet_book_classify_id" jdbcType="BIGINT" property="appletBookClassifyId" /> <result column="applet_book_classify_id" jdbcType="BIGINT" property="appletBookClassifyId" />
<result column="creat_time" jdbcType="TIMESTAMP" property="creatTime" /> <result column="creat_time" jdbcType="TIMESTAMP" property="creatTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<resultMap id="DTOResultMap" type="com.pcloud.book.applet.dto.AppletUserLabelDTO"> <resultMap id="DTOResultMap" type="com.pcloud.book.applet.dto.AppletUserLabelDTO">
<id column="aid" jdbcType="BIGINT" property="id" /> <id column="aid" jdbcType="BIGINT" property="id" />
<result column="label_name" jdbcType="VARCHAR" property="labelName" /> <result column="label_name" jdbcType="VARCHAR" property="labelName" />
<result column="applet_book_classify_id" jdbcType="BIGINT" property="appletBookClassifyId" /> <result column="applet_book_classify_id" jdbcType="BIGINT" property="appletBookClassifyId" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
<collection property="appletUserLabelRelations" ofType="com.pcloud.book.applet.entity.AppletUserLabelRelation"> <collection property="appletUserLabelRelations" ofType="com.pcloud.book.applet.entity.AppletUserLabelRelation">
<id column="arid" property="id" jdbcType="BIGINT"/> <id column="arid" property="id" jdbcType="BIGINT"/>
<id column="aid" property="appletUserLabelId" jdbcType="BIGINT"/> <id column="aid" property="appletUserLabelId" jdbcType="BIGINT"/>
...@@ -22,7 +24,7 @@ ...@@ -22,7 +24,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, label_name, applet_book_classify_id, creat_time, update_time id, label_name, applet_book_classify_id, creat_time, update_time, agent_id
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
...@@ -31,16 +33,24 @@ ...@@ -31,16 +33,24 @@
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<select id="listUserLabel" resultMap="DTOResultMap" parameterType="long"> <select id="listUserLabel" resultMap="DTOResultMap" parameterType="map">
select select
a.id aid, label_name, applet_book_classify_id, a.id aid, label_name, applet_book_classify_id,
ar.id arid, ar.book_label_id, ar.label_type ar.id arid, ar.book_label_id, ar.label_type, a.agent_id
from from
applet_user_label a applet_user_label a
left join applet_user_label_relation ar on a.id = ar.applet_user_label_id left join applet_user_label_relation ar on a.id = ar.applet_user_label_id
where where
a.applet_book_classify_id = #{appletBookClassifyId} a.applet_book_classify_id = #{appletBookClassifyId}
order by create_time desc <choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
order by a.creat_time desc
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
...@@ -49,9 +59,9 @@ ...@@ -49,9 +59,9 @@
</delete> </delete>
<insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletUserLabel" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletUserLabel" useGeneratedKeys="true" keyProperty="id">
insert into applet_user_label (id, label_name, applet_book_classify_id, insert into applet_user_label (id, label_name, applet_book_classify_id,
creat_time, update_time) creat_time, update_time, agent_id)
values (#{id,jdbcType=BIGINT}, #{labelName,jdbcType=VARCHAR}, #{appletBookClassifyId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{labelName,jdbcType=VARCHAR}, #{appletBookClassifyId,jdbcType=BIGINT},
now(), now()) now(), now(), #{agentId})
</insert> </insert>
<insert id="insertSelective" parameterType="com.pcloud.book.applet.entity.AppletUserLabel"> <insert id="insertSelective" parameterType="com.pcloud.book.applet.entity.AppletUserLabel">
insert into applet_user_label insert into applet_user_label
...@@ -124,6 +134,15 @@ ...@@ -124,6 +134,15 @@
FROM FROM
applet_user_label l applet_user_label l
LEFT JOIN applet_book_classify c ON l.applet_book_classify_id = c.id LEFT JOIN applet_book_classify c ON l.applet_book_classify_id = c.id
WHERE 1=1
<choose>
<when test="agentId != null">
and l.agent_id = #{agentId}
</when>
<otherwise>
and l.agent_id = 0
</otherwise>
</choose>
ORDER BY l.creat_time DESC ORDER BY l.creat_time DESC
</select> </select>
......
...@@ -2114,7 +2114,7 @@ ...@@ -2114,7 +2114,7 @@
COUNT(1) COUNT(1)
FROM FROM
BOOK_ADVISER A BOOK_ADVISER A
LEFT JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0 INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0
WHERE WHERE
A.IS_MAIN_EDITOR = 1 AND A.IS_DELETE = 0 A.IS_MAIN_EDITOR = 1 AND A.IS_DELETE = 0
<if test="typeCode!=null"> <if test="typeCode!=null">
...@@ -2473,4 +2473,41 @@ ...@@ -2473,4 +2473,41 @@
where book_id = #{item.bookId} where book_id = #{item.bookId}
</foreach> </foreach>
</update> </update>
<!-- 获取社群书列表(小睿独立管理端) -->
<select id="listBookGroup4AppletAgent" resultMap="bookMap" parameterType="map">
SELECT
A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, a.is_open_robot_process, B.ISBN, B.BOOK_NAME, B.REMARK,
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
A.TEMPLET_ID, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber,
G.update_time LAST_MODIFIED_DATE, G.create_time CREATED_DATE, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl,
G.group_qrcode_name groupQrcodeName, G.dep_label_id bookGroupDepLabelId, G.join_group_type,
G.related_book_group_id relatedBookGroupId, A.IS_PRINT isPrint
FROM
book_group G
INNER JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID
INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID
WHERE
G.agent_id = #{agentId}
AND G.is_delete = 0
AND A.IS_DELETE = 0
AND B.IS_DELETE = 0
<if test="adviserId != null">
AND G.create_user = #{adviserId}
</if>
<if test="name != null">
AND
(B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%')
OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name}
)
</if>
<if test="joinGroupType != null">
AND G.join_group_type = #{joinGroupType}
</if>
GROUP BY B.BOOK_ID
ORDER BY
G.UPDATE_TIME DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,18 +18,18 @@ ...@@ -18,18 +18,18 @@
<result property="useType" column="use_type" jdbcType="INTEGER"/> <result property="useType" column="use_type" jdbcType="INTEGER"/>
<result property="exchangeAddress" column="exchange_address" jdbcType="VARCHAR"/> <result property="exchangeAddress" column="exchange_address" jdbcType="VARCHAR"/>
<result property="urlNumber" column="url_number" jdbcType="VARCHAR" /> <result property="urlNumber" column="url_number" jdbcType="VARCHAR" />
<result property="agentId" column="agent_id" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, cover_pic, title, valid_date_begin, valid_date_end, denomination, stock, receive_limit, create_time, update_time, is_delete, id, cover_pic, title, valid_date_begin, valid_date_end, denomination, stock, receive_limit, create_time, update_time, is_delete,
coupon_type,instructions,use_type,exchange_address, url_number coupon_type,instructions,use_type,exchange_address, url_number, agent_id
</sql> </sql>
<!--查询单个--> <!--查询单个-->
<select id="getById" resultMap="GiftCouplePackageMap"> <select id="getById" resultMap="GiftCouplePackageMap">
select select
id, cover_pic, title, valid_date_begin, valid_date_end, denomination, stock, receive_limit, create_time, update_time, is_delete, <include refid="Base_Column_List"/>
coupon_type,instructions,use_type,exchange_address,url_number
from book.gift_coupon_package from book.gift_coupon_package
where id = #{id} where id = #{id}
and is_delete=0 and is_delete=0
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" parameterType="com.pcloud.book.giftcoupon.entity.GiftCouponPackage" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" parameterType="com.pcloud.book.giftcoupon.entity.GiftCouponPackage" keyProperty="id" useGeneratedKeys="true">
insert into book.gift_coupon_package(cover_pic, title, valid_date_begin, valid_date_end, denomination, stock, receive_limit, create_time, update_time, is_delete, insert into book.gift_coupon_package(cover_pic, title, valid_date_begin, valid_date_end, denomination, stock, receive_limit, create_time, update_time, is_delete,
coupon_type,instructions,use_type,exchange_address,url_number) coupon_type,instructions,use_type,exchange_address,url_number, agent_id)
values (#{coverPic}, #{title}, #{validDateBegin}, #{validDateEnd}, #{denomination}, #{stock}, #{receiveLimit}, now(), now(), 0, values (#{coverPic}, #{title}, #{validDateBegin}, #{validDateEnd}, #{denomination}, #{stock}, #{receiveLimit}, now(), now(), 0,
#{couponType},#{instructions},#{useType},#{exchangeAddress}, #{urlNumber}) #{couponType},#{instructions},#{useType},#{exchangeAddress}, #{urlNumber}, #{agentId})
</insert> </insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
...@@ -187,6 +187,14 @@ ...@@ -187,6 +187,14 @@
and a.coupon_type=#{couponType} and a.coupon_type=#{couponType}
</if> </if>
and a.receive_limit>0 and a.receive_limit>0
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
GROUP BY a.id GROUP BY a.id
order by a.update_time desc order by a.update_time desc
...@@ -236,7 +244,7 @@ ...@@ -236,7 +244,7 @@
and stock<![CDATA[ <= ]]>0 and stock<![CDATA[ <= ]]>0
</select> </select>
<select id="getUrlNumberByAddress" parameterType="string" resultType="string"> <select id="getUrlNumberByAddress" parameterType="map" resultType="string">
SELECT SELECT
url_number url_number
FROM FROM
...@@ -246,6 +254,14 @@ ...@@ -246,6 +254,14 @@
AND coupon_type = 1 AND coupon_type = 1
AND use_type = 1 AND use_type = 1
AND url_number IS NOT NULL AND url_number IS NOT NULL
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
LIMIT 1 LIMIT 1
</select> </select>
...@@ -263,6 +279,14 @@ ...@@ -263,6 +279,14 @@
<if test="id>0"> <if test="id>0">
AND id != #{id} AND id != #{id}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
) )
</select> </select>
...@@ -308,6 +332,14 @@ ...@@ -308,6 +332,14 @@
and a.coupon_type = 1 and a.coupon_type = 1
</if> </if>
and a.receive_limit>0 and a.receive_limit>0
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
order by a.update_time desc order by a.update_time desc
</select> </select>
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="is_delete" property="isDelete" jdbcType="BIT"/> <result column="is_delete" property="isDelete" jdbcType="BIT"/>
<result column="scene_id" property="sceneId" jdbcType="BIGINT"/> <result column="scene_id" property="sceneId" jdbcType="BIGINT"/>
<result column="account_setting_id" property="accountSettingId" jdbcType="BIGINT"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, book_group_id, rays_classify_id, applet_id, applet_url, create_time, update_time, is_delete,scene_id id, book_group_id, rays_classify_id, applet_id, applet_url, create_time, update_time, is_delete,scene_id,account_setting_id
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.BookAppletScene" useGeneratedKeys="true" <insert id="insert" parameterType="com.pcloud.book.group.entity.BookAppletScene" useGeneratedKeys="true"
...@@ -28,7 +29,8 @@ ...@@ -28,7 +29,8 @@
applet_url, applet_url,
create_time, create_time,
update_time, update_time,
is_delete is_delete,
account_setting_id
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{bookGroupId,jdbcType=BIGINT}, #{bookGroupId,jdbcType=BIGINT},
...@@ -37,7 +39,8 @@ ...@@ -37,7 +39,8 @@
#{appletUrl,jdbcType=VARCHAR}, #{appletUrl,jdbcType=VARCHAR},
NOW(), NOW(),
NOW(), NOW(),
0 0,
#{accountSettingId}
</trim> </trim>
</insert> </insert>
...@@ -50,7 +53,8 @@ ...@@ -50,7 +53,8 @@
create_time, create_time,
update_time, update_time,
is_delete, is_delete,
scene_id scene_id,
account_setting_id
) values ) values
<foreach collection="list" item="item" index="index" <foreach collection="list" item="item" index="index"
separator=","> separator=",">
...@@ -60,7 +64,9 @@ ...@@ -60,7 +64,9 @@
NOW(), NOW(),
NOW(), NOW(),
0, 0,
#{item.sceneId,jdbcType=BIGINT}) #{item.sceneId,jdbcType=BIGINT},
#{item.accountSettingId}
)
</foreach> </foreach>
</insert> </insert>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result property="defaultPic" column="default_pic" jdbcType="BOOLEAN"/> <result property="defaultPic" column="default_pic" jdbcType="BOOLEAN"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="type" column="type" jdbcType="INTEGER"/> <result property="type" column="type" jdbcType="INTEGER"/>
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -29,13 +30,14 @@ ...@@ -29,13 +30,14 @@
<insert id="insert" parameterType="com.pcloud.book.rightsSetting.entity.RightsNowPic" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.rightsSetting.entity.RightsNowPic" useGeneratedKeys="true" keyProperty="id">
insert into rights_now_pic insert into rights_now_pic
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
pic_url, default_pic, create_time, type pic_url, default_pic, create_time, type, agent_id
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{picUrl,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
#{defaultPic,jdbcType=BOOLEAN}, #{defaultPic,jdbcType=BOOLEAN},
NOW(), NOW(),
#{type} #{type},
#{agentId}
</trim> </trim>
</insert> </insert>
...@@ -69,6 +71,14 @@ ...@@ -69,6 +71,14 @@
<if test="type != null"> <if test="type != null">
and type = #{type} and type = #{type}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
order by create_time desc order by create_time desc
</select> </select>
......
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
<result column="grade_label_id" property="gradeLabelId" jdbcType="BIGINT" /> <result column="grade_label_id" property="gradeLabelId" jdbcType="BIGINT" />
<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" />
</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, grade_label_id, subject_label_id,media_id first_classify, second_classify, grade_label_id, subject_label_id,media_id, agent_id
</sql> </sql>
<update id="batchUpdateClassify" parameterType="map"> <update id="batchUpdateClassify" parameterType="map">
...@@ -51,6 +52,14 @@ ...@@ -51,6 +52,14 @@
select count(1) select count(1)
from pcloud_group_activity from pcloud_group_activity
where number=#{number} where number=#{number}
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
and is_delete = 0 and is_delete = 0
</select> </select>
...@@ -94,6 +103,14 @@ ...@@ -94,6 +103,14 @@
<if test="subjectLabelId != null"> <if test="subjectLabelId != null">
and subject_label_id = #{subjectLabelId} and subject_label_id = #{subjectLabelId}
</if> </if>
<choose>
<when test="agentId != null">
and agent_id = #{agentId}
</when>
<otherwise>
and agent_id = 0
</otherwise>
</choose>
order by id desc order by id desc
</select> </select>
...@@ -152,6 +169,14 @@ ...@@ -152,6 +169,14 @@
and b.city_code = #{cityCode} and b.city_code = #{cityCode}
and a.group_type != 1 and a.group_type != 1
</if> </if>
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
order by a.id desc order by a.id desc
</select> </select>
...@@ -198,6 +223,14 @@ ...@@ -198,6 +223,14 @@
AND a.join_type = #{joinType} AND a.join_type = #{joinType}
</if> </if>
AND a.is_delete = 0 AND a.is_delete = 0
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
</where> </where>
GROUP BY a.id GROUP BY a.id
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
...@@ -244,8 +277,16 @@ ...@@ -244,8 +277,16 @@
<if test="subjectLabelId != null"> <if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId} and a.subject_label_id = #{subjectLabelId}
</if> </if>
<choose>
<when test="agentId >0">
and a.agent_id in (#{agentId} ,0)
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
GROUP BY a.id GROUP BY a.id
ORDER BY a.id DESC ORDER BY a.agent_id desc, a.id DESC
LIMIT #{limit} LIMIT #{limit}
</select> </select>
...@@ -273,7 +314,8 @@ ...@@ -273,7 +314,8 @@
a.number, a.number,
a.group_extLink, a.group_extLink,
a.group_type, a.group_type,
a.media_id a.media_id,
a.agent_id
FROM pcloud_group_activity a LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id FROM pcloud_group_activity a LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id
WHERE a.id = #{id,jdbcType=INTEGER} and a.is_delete = 0 WHERE a.id = #{id,jdbcType=INTEGER} and a.is_delete = 0
</select> </select>
...@@ -427,13 +469,15 @@ ...@@ -427,13 +469,15 @@
description, join_type, group_pic, pro_label_id, dep_label_id, description, join_type, group_pic, pro_label_id, dep_label_id,
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, grade_label_id, subject_label_id,number,group_type,group_extLink) is_delete, first_classify, second_classify, grade_label_id, subject_label_id,number,
group_type,group_extLink, agent_id)
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}, #{isDelete,jdbcType=BIT}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT}, #{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR}) #{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT},
#{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR}, #{agentId})
</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
...@@ -575,6 +619,14 @@ ...@@ -575,6 +619,14 @@
<if test="subjectLabelId != null"> <if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId} and a.subject_label_id = #{subjectLabelId}
</if> </if>
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
GROUP BY a.id GROUP BY a.id
ORDER BY a.id DESC ORDER BY a.id DESC
</select> </select>
...@@ -608,8 +660,41 @@ ...@@ -608,8 +660,41 @@
a.is_delete = 0 AND a.is_show = 1 AND IFNULL(b.is_delete,0) = 0 a.is_delete = 0 AND a.is_show = 1 AND IFNULL(b.is_delete,0) = 0
and c.city_code = #{cityCode} and c.city_code = #{cityCode}
and a.group_type != 1 and a.group_type != 1
<choose>
<when test="agentId != null">
and a.agent_id = #{agentId}
</when>
<otherwise>
and a.agent_id = 0
</otherwise>
</choose>
GROUP BY a.id GROUP BY a.id
ORDER BY a.id DESC ORDER BY a.id DESC
</select> </select>
<select id="getByActivityId" resultType="com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO" parameterType="long" >
SELECT
a.id,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.book_group_classify_id AS bookGroupClassifyId,
a.pro_label_id AS proLabelId,
a.dep_label_id AS depLabelId,
a.pur_label_id AS purLabelId,
b.classify AS classifyName,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
a.number,
a.group_extLink as groupExtLink,
a.group_type as groupType,
is_show AS isShow
FROM
pcloud_group_activity a left join book_group_classify b on a.book_group_classify_id = b.id
WHERE
a.id = #{id}
</select>
</mapper> </mapper>
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