Commit e4d6ba56 by 李传峰

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

parents f057df76 98cb038e
......@@ -449,4 +449,9 @@ public class BookConstant {
public static String IGNOR_BOOK_KEY = CacheConstant.BOOK + "ignorBookKey";
/**
* qq公众号
*/
public static final Long QQ_ACCOUNT_SETTING_ID = 999L;
}
package com.pcloud.book.group.dto;
import com.pcloud.common.dto.BaseDto;
import lombok.Data;
/**
* @ClassName com.pcloud.book.group.dto.ResourcePageDTO
* @Author zhuyajie
* @Description 资源页信息
* @Date 2021/8/30 11:04
* @Version 1.0
**/
@Data
public class ResourcePageDTO extends BaseDto {
/**
* rays码id
*/
private Long bookGroupId;
/**
* 风格类型(1默认2艺术3插画)
*/
private Integer style;
/**
* 是否显示图书信息
*/
private Integer showBook;
/**
* 是否开启小睿流程
*/
private Integer openRays;
/**
* 是否开启世间食记
*/
private Integer openFood;
/**
* 创建人
*/
private Long createUser;
/**
* 预览二维码
*/
private String qrcodeUrl;
/**
* 二维码id
*/
private Long sceneId;
/**
* 公众号二维码id
*/
private Long officialSceneId;
/**
* 自定义配置的图书封面
*/
private String bookCover;
/**
* 书刊id
*/
private Long bookId;
/**
* 渠道id
*/
private Long channelId;
/**
* 背景图
*/
private String backgroundImg;
/**
* 二维码图片解析后的地址
*/
private String url;
}
......@@ -19,6 +19,7 @@ import com.pcloud.book.group.dto.MapBookGroupServeCountDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QueryByBookAdviserDTO;
import com.pcloud.book.group.dto.ResourceBrowseParamDto;
import com.pcloud.book.group.dto.ResourcePageDTO;
import com.pcloud.book.group.dto.SelfRobotBookGroupDTO;
import com.pcloud.book.group.dto.SelfRobotUserDTO;
import com.pcloud.book.group.dto.SelfRobtParamDTO;
......@@ -282,4 +283,8 @@ public interface BookGroupService {
@GetMapping("isOpenRaysScene")
ResponseEntity<ResponseDto<Boolean>> isOpenRaysScene(@RequestParam(value = "sceneId", required = false) Long sceneId,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId);
@ApiOperation("查资源页信息")
@GetMapping("getResourcePageById")
ResponseEntity<ResponseDto<ResourcePageDTO>> getResourcePageById(@RequestParam("resourcePageId") Long resourcePageId);
}
......@@ -43,6 +43,8 @@ import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import static com.pcloud.book.book.constant.BookConstant.QQ_ACCOUNT_SETTING_ID;
/**
* @ClassName com.pcloud.book.applet.biz.impl.AnswerSubscribeBizImpl
* @Author zhuyajie
......@@ -294,6 +296,10 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
@Override
public AnswerSubscribeDTO getSubscribeQrcodeState(Long wechatUserId, Long accountSettingId) {
AnswerSubscribeDTO dto = new AnswerSubscribeDTO();
if (QQ_ACCOUNT_SETTING_ID.equals(accountSettingId)) {
return dto;
}
String openId = readerConsr.getOpenIdByWechatUserIdAndOfficialAccountsId(wechatUserId, accountSettingId);
WechatUserOfficialAccounts accounts = readerConsr.getOfficialAccounts(accountSettingId, openId, wechatUserId);
Boolean isSubscribe = false;
......@@ -301,7 +307,6 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
isSubscribe = accounts.getIsSubscribe() == 1 ? true : false;
}
GroupQrcodeVO groupQrcodeVO = qrcodeSceneConsr.getSubscribeQrcode(accountSettingId);
AnswerSubscribeDTO dto = new AnswerSubscribeDTO();
dto.setQrcodeUrl(groupQrcodeVO.getQrcodeUrl());
dto.setIsSubscribe(isSubscribe);
return dto;
......
......@@ -91,7 +91,8 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt
@Override
@ParamLog("获取跟谁学统计数据")
public void getAppletThirdResourceStatic(Integer isAll) {
PageBeanNew pageBeanNew = null;
//20210831 接口调用不通 ,暂停调用
/*PageBeanNew pageBeanNew = null;
//PageBeanNew pageBeanNew = appletThirdResourcesStaticDao.listPageNew(new PageParam(0, 10), null, "getList");
if (null != pageBeanNew && !ListUtils.isEmpty(pageBeanNew.getRecordList()) && YesOrNoEnums.YES.getValue().equals(isAll)) {
throw new BookBizException(BookBizException.ERROR, "当统计数据表不为空时不能导入全部数据只能导入昨日数据");
......@@ -134,7 +135,7 @@ public class AppletThirdResourcesStaticBizImpl implements AppletThirdResourcesSt
} catch (ParseException e) {
LOGGER.error("获取跟谁学统计数据失败", e);
}
}
}*/
}
......
......@@ -1608,7 +1608,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Map<String, BookAdviserDto> bookAdviserDtoMap = new HashMap<>();
try {
bookAdviserDtoMap = bookAdviserSubmit.get(ThreadPoolUtils.REMOTE_TIME_OUT, TimeUnit.SECONDS);
bookAdviserDtoMap = bookAdviserSubmit.get(ThreadPoolUtils.REMOTE_TIME_OUT_LONG, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOGGER.error("获取现代纸书是否小睿流程错误: {}==", e);
}
......@@ -2736,6 +2736,9 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
String key = CacheConstant.BOOK + "BOOKIDS4AGENT:" + agentId+"_"+month;
if (StringUtil.isEmpty(JedisClusterUtils.get(key))) {
List<Long> adviserIds = adviserConsr.getByAgentId(agentId);
if (CollUtil.isEmpty(adviserIds)) {
return new ArrayList<>();
}
List<ERPPublishNumDTO> erpPublishNumQueryParams = bookAdviserDao.getErpPublishNumQueryParamsByMonth(adviserIds,month);
if (ListUtils.isEmpty(erpPublishNumQueryParams)) {
return new ArrayList<>();
......
......@@ -118,6 +118,7 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import com.pcloud.usercenter.party.agent.dto.SaleAgentDTO;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
......@@ -2740,6 +2741,9 @@ public class BookBizImpl implements BookBiz {
if (null != agentId) {
adviserIds = adviserConsr.getByAgentId(agentId);
}
if (!StringUtil.isEmpty(keyword)) {
keyword = QueryParser.escape(keyword);
}
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getESAdviserBooks4AppletV2(grayStatus, keyword, templetIds, graLabelIds, subLabelIds,
currentPage, numPerPage,scecondTempletIds, adviserIds, agentId);
......
......@@ -12,8 +12,10 @@ import com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO;
import com.pcloud.channelcenter.qrcode.dto.OwnMessageDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
import com.pcloud.channelcenter.qrcode.entity.QrcodeScene;
import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp;
import com.pcloud.channelcenter.qrcode.service.QrcodeLocationAssocService;
import com.pcloud.channelcenter.qrcode.service.QrcodeSceneService;
import com.pcloud.channelcenter.qrcode.service.QrcodeTempService;
import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrAskVO;
import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrVO;
import com.pcloud.channelcenter.qrcode.vo.BookAssocQRcountRequestVO;
......@@ -70,7 +72,8 @@ public class QrcodeSceneConsr {
private AccountSettingService accountSettingService;
@Autowired
private QrcodeLocationAssocService qrcodeLocationAssocService;
@Autowired
private QrcodeTempService qrcodeTempService;
/**
......@@ -622,4 +625,17 @@ public class QrcodeSceneConsr {
return accountSetting;
}
public String createTempQrcode4H5(QrcodeTemp qrcodeTemp) {
LOGGER.info("H5创建公众号临时二维码,qrcodeTemp={}",qrcodeTemp.toString());
String qrcode = "";
if (null == qrcodeTemp) {
return qrcode;
}
try {
qrcode = ResponseHandleUtil.parseResponse(qrcodeTempService.createTempQrcode4H5(qrcodeTemp), String.class);
} catch (Exception e) {
LOGGER.error("H5创建公众号临时二维码失败"+e.getMessage(), e);
}
return qrcode;
}
}
......@@ -7,6 +7,7 @@ import com.pcloud.book.group.dto.BookGroupServeDTO;
import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.book.group.dto.NavigationParamDTO;
import com.pcloud.book.group.dto.ResourcePageCourseDTO;
import com.pcloud.book.group.dto.ResourcePageDTO;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.entity.ResourcePage;
import com.pcloud.book.group.entity.ResourcePageCollect;
......@@ -440,4 +441,20 @@ public interface ResourcePageBiz {
* * @param null
*/
void batchUpdateColumnSeq(List<Long> navigationIds);
/**
* 客户端-根据页面id查要弹出的二维码
* @author:zhuyajie
* @date:2021/8/23 17:31
* * @param null
*/
ResourcePageItemVO getPopupQrcode4Wechat(Long resourcePageId, Long wechatUserId);
/**
* 查资源页信息
* @author:zhuyajie
* @date:2021/8/30 11:08
* * @param null
*/
ResourcePageDTO getResourcePageById(Long resourcePageId);
}
......@@ -5103,11 +5103,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
Long raysClassifyId = null;
BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId);
if (null != bookAdviserDto) {
if (null != bookAdviserDto && null != bookAdviserDto.getTempletId()) {
raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId());
}
if (null == raysClassifyId) {
LOGGER.error("书刊分类没有对应的小睿分类" + bookGroupId);
if (null == raysClassifyId) {
LOGGER.warn("书刊分类没有对应的小睿分类" + bookGroupId);
}
}
String page = null;//小程序跳转页 todo
String appletId = createOneAppletId();
......
......@@ -29,7 +29,8 @@ public class ResourcePageConstants {
GROUP(4, "社群", new String[]{ServeTypeEnum.GROUP_ACTIVITY.getValue(), ServeTypeEnum.WXWORK_GROUP.getValue()}),
THIRD_RESOURCE(5, "第三方资源", new String[]{ServeTypeEnum.THIRD_RESOURCE.getValue()}),
PICTURE(6, "图片位", new String[]{ServeTypeEnum.APP.getValue(), ServeTypeEnum.PRODUCT.getValue(),
ServeTypeEnum.GROUP_ACTIVITY.getValue(), ServeTypeEnum.THIRD_RESOURCE.getValue()});
ServeTypeEnum.GROUP_ACTIVITY.getValue(), ServeTypeEnum.THIRD_RESOURCE.getValue()}),
RAYS_TOOL(7,"RAYS工具",new String[]{ServeTypeEnum.APP.getValue()});
private Integer code;
private String name;
......@@ -377,4 +378,29 @@ public class ResourcePageConstants {
//小程序默认导航,书友互助、阅读打卡
public static List<Integer> APPLET_DEFAULT_NAVIGATIONS = Arrays.asList(ResourcePageConstants.NavigationTypeEnum.APPLET_QA.getCode(),
ResourcePageConstants.NavigationTypeEnum.CLOCK.getCode());
/**
* H5-公众号二维码展示方式
* @author:zhuyajie
* @date:2021/8/23 15:14
* * @param null
*/
public enum QrcodeShowTypeEnum{
//1平铺2弹窗
TILED(1),
POPUP(2);
private Integer code;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
QrcodeShowTypeEnum(Integer code) {
this.code = code;
}
}
}
......@@ -122,4 +122,12 @@ public interface ResourcePageItemDao extends BaseDao<ResourcePageItem>{
* * @param null
*/
List<BookServeDTO> getBookAllServeIds(Long adviserId, Long bookId, Long channelId);
/**
* 配置的弹窗类型公众号
* @author:zhuyajie
* @date:2021/8/23 17:52
* * @param null
*/
ResourcePageItemVO getPopupQrcodeItem(Long resourcePageId);
}
\ No newline at end of file
......@@ -122,4 +122,9 @@ public class ResourcePageItemDaoImpl extends BaseDaoImpl<ResourcePageItem> imple
map.put("channelId", channelId);
return getSessionTemplate().selectList(getStatement("getBookAllServeIds"), map);
}
@Override
public ResourcePageItemVO getPopupQrcodeItem(Long resourcePageId) {
return getSessionTemplate().selectOne(getStatement("getPopupQrcodeItem"), resourcePageId);
}
}
......@@ -64,4 +64,12 @@ public class ResourcePageItem extends BaseEntity {
* 二维码来源
*/
private Integer qrcodeSource;
/**
* 二维码展示方式(1平铺2弹窗)
*/
private Integer qrcodeShowType;
/**
* 二维码公众号id
*/
private Long accountSettingId;
}
......@@ -327,4 +327,12 @@ public class ResourcePageFacade {
resourcePageBiz.batchUpdateColumnSeq(navigationIds);
return new ResponseDto<>();
}
@ApiOperation("客户端-根据页面id查要弹出的二维码")
@GetMapping("getPopupQrcode4Wechat")
public ResponseDto<?> getPopupQrcode4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam("resourcePageId") Long resourcePageId){
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getPopupQrcode4Wechat(resourcePageId, wechatUserId));
}
}
......@@ -22,6 +22,7 @@ import com.pcloud.book.group.dto.MapBookGroupServeCountDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QueryByBookAdviserDTO;
import com.pcloud.book.group.dto.ResourceBrowseParamDto;
import com.pcloud.book.group.dto.ResourcePageDTO;
import com.pcloud.book.group.dto.SelfRobotBookGroupDTO;
import com.pcloud.book.group.dto.SelfRobotUserDTO;
import com.pcloud.book.group.dto.SelfRobtParamDTO;
......@@ -483,4 +484,10 @@ public class BookGroupServiceImpl implements BookGroupService {
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId) {
return ResponseHandleUtil.toResponse(resourcePageBiz.isOpenRaysScene(sceneId, bookGroupId));
}
@Override
@GetMapping("getResourcePageById")
public ResponseEntity<ResponseDto<ResourcePageDTO>> getResourcePageById(@RequestParam("resourcePageId") Long resourcePageId) {
return ResponseHandleUtil.toResponse(resourcePageBiz.getResourcePageById(resourcePageId));
}
}
package com.pcloud.book.group.vo;
import com.pcloud.book.applet.dto.AppletNewsDTO;
import com.pcloud.book.applet.dto.AppletOuterBooklistDTO;
import com.pcloud.book.applet.dto.GroupActivity4AppletDTO;
import com.pcloud.book.applet.entity.AppletThirdResources;
import com.pcloud.book.book.vo.BookLinkVO;
import com.pcloud.book.book.vo.response.BookQrcodeWxworkResponseVO;
import com.pcloud.common.dto.BaseDto;
import com.pcloud.wechatgroup.wxwork.dto.WxworkGroupQrcodeBaseDTO;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -106,4 +100,20 @@ public class ResourcePageItemVO extends BaseDto{
private String qrcodeType;
private Integer jumpType;
/**
* 二维码展示方式(1平铺2弹窗)
*/
private Integer qrcodeShowType;
/**
* 二维码公众号id
*/
private Long accountSettingId;
/**
* 二维码公众号名称
*/
private String accountSettingName;
/**
* 二维码公众号弹出状态
*/
private Boolean popupState;
}
......@@ -322,7 +322,7 @@ public class PushBizImpl implements PushBiz {
//获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) {
LOGGER.error("未找到群信息!qrcodeId=" + pushGroup.getBookGroupQrcodeId());
LOGGER.warn("未找到群信息!qrcodeId=" + pushGroup.getBookGroupQrcodeId());
continue;
}
//获取机器人微信号
......@@ -334,9 +334,8 @@ public class PushBizImpl implements PushBiz {
LOGGER.info("发送一个群里的一个消息结束,休眠1秒pushGroup=" + pushGroup.toString() + "pushItem=" + pushItem.toString() + "altId=" + altId);
Thread.sleep(1000);
} catch (InterruptedException e) {
LOGGER.error("发消息休眠1秒出错", e);
LOGGER.warn("发消息休眠1秒出错");
}
}
}
}
......@@ -349,8 +348,7 @@ public class PushBizImpl implements PushBiz {
//获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) {
LOGGER.error("未找到群信息!");
return;
throw new BookBizException(BookBizException.PARAM_IS_NULL, "未找到群信息");
}
String groupId = groupQrcode.getWeixinGroupId();
ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(groupQrcode.getClassifyId());
......
......@@ -14,6 +14,11 @@ public class ThreadPoolUtils {
*/
public static final int REMOTE_TIME_OUT = 5;
/**
* 远程调用超时时间(单位:秒)
*/
public static final int REMOTE_TIME_OUT_LONG = 30;
/**
* 异步导出线程池
......
......@@ -17,13 +17,20 @@
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="qrcodeSource" column="qrcode_source" jdbcType="INTEGER"/>
<result property="qrcodeShowType" column="qrcode_show_type" jdbcType="INTEGER"/>
<result property="accountSettingId" column="account_setting_id" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, resource_page_id, resource_page_column_id, serve_id, serve_type, link_url, type_code, seq_num, is_show,
guide_content, logo_url, create_time, qrcode_source, qrcode_show_type, account_setting_id
</sql>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageItemMap">
select
id, resource_page_id, resource_page_column_id, serve_id, serve_type, link_url, type_code, seq_num, is_show,
guide_content, logo_url, create_time
<include refid="Base_Column_List"/>
from book.resource_page_item
where id = #{id}
</select>
......@@ -31,20 +38,22 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_item(resource_page_id, resource_page_column_id, serve_id, serve_type, link_url, type_code,
seq_num, is_show, guide_content, logo_url, create_time, update_time, create_user, qrcode_source)
seq_num, is_show, guide_content, logo_url, create_time, update_time, create_user, qrcode_source,
qrcode_show_type, account_setting_id)
values (#{resourcePageId}, #{resourcePageColumnId}, #{serveId}, #{serveType}, #{linkUrl}, #{typeCode},
#{seqNum}, #{isShow}, #{guideContent}, #{logoUrl}, now(), now(), #{createUser}, #{qrcodeSource})
#{seqNum}, #{isShow}, #{guideContent}, #{logoUrl}, now(), now(), #{createUser}, #{qrcodeSource},
#{qrcodeShowType}, #{accountSettingId})
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_item(resource_page_id, resource_page_column_id, serve_id, serve_type,
link_url, type_code, seq_num, is_show, guide_content, logo_url,
create_time, update_time, create_user, qrcode_source)
create_time, update_time, create_user, qrcode_source, qrcode_show_type, account_setting_id)
values
<foreach collection="list" separator="," index="index" item="item">
(#{item.resourcePageId}, #{item.resourcePageColumnId}, #{item.serveId}, #{item.serveType},
#{item.linkUrl}, #{item.typeCode}, #{item.seqNum}, #{item.isShow}, #{item.guideContent}, #{item.logoUrl},
now(), now(), #{item.createUser}, #{item.qrcodeSource})
now(), now(), #{item.createUser}, #{item.qrcodeSource}, #{item.qrcodeShowType}, #{item.accountSettingId})
</foreach>
</insert>
......@@ -110,7 +119,9 @@
guide_content guideContent,
qrcode_source qrcodeSource,
create_user createUser,
seq_num seqNum
seq_num seqNum,
qrcode_show_type qrcodeShowType,
account_setting_id accountSettingId
FROM
resource_page_item
WHERE
......@@ -319,4 +330,29 @@
i.serve_type,
i.serve_id
</select>
<select id="getPopupQrcodeItem" resultType="com.pcloud.book.group.vo.ResourcePageItemVO" parameterType="map">
SELECT
id,
serve_id serveId,
serve_type serveType,
link_url linkUrl,
resource_page_column_id resourcePageColumnId,
type_code typeCode,
logo_url logoUrl,
guide_content guideContent,
qrcode_source qrcodeSource,
create_user createUser,
seq_num seqNum,
qrcode_show_type qrcodeShowType,
account_setting_id accountSettingId
FROM
resource_page_item
WHERE
resource_page_id = #{resourcePageId}
and qrcode_show_type = 2
and serve_type = 'OFFICIAL_ACCOUNT'
limit 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment