Commit 3ee3566b by 田超

Merge branch 'feat-zyj-1003012' into 'master'

10030121v1社群码转小睿流程

See merge request rays/pcloud-book!755
parents 618979da 436bfa9c
......@@ -670,6 +670,19 @@ public class BookDto extends BaseDto {
*/
private Long volLabelId;
/**
* 是否开启小睿流程
*/
private Boolean openWeapp;
public Boolean getOpenWeapp() {
return openWeapp;
}
public void setOpenWeapp(Boolean openWeapp) {
this.openWeapp = openWeapp;
}
public Long getVolLabelId() {
return volLabelId;
}
......@@ -1931,6 +1944,7 @@ public class BookDto extends BaseDto {
", isOpenRobotProcess=" + isOpenRobotProcess +
", classifyId=" + classifyId +
", volLabelId=" + volLabelId +
", openWeapp=" + openWeapp +
'}';
}
}
......@@ -816,7 +816,7 @@ public interface BookGroupBiz {
* @param wechatUserId
* @param scene
*/
void getByAppletScene(Long wechatUserId, String scene);
BookGroupDTO getByAppletScene(Long wechatUserId, String scene);
/**
* 获取小睿社群书和现代纸书所配资源
......@@ -848,4 +848,12 @@ public interface BookGroupBiz {
Map<String,Object> getBookBaseInfo4Applet(Long adviserId, Long channelId, Long bookId);
PageBeanNew<BookGroupClassifyDTO> getBookGroupClassifyByAdviserId(Long adviserId, String classify, Integer currentPage , Integer numPerPage);
/**
* 1V1社群书是否开启小睿流程
* @author:zhuyajie
* @date:2020/6/5 11:20
* * @param null
*/
void updateBookGroupOpenWeapp(Long bookGroupId, Boolean openWeapp);
}
......@@ -4701,8 +4701,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
LOGGER.info("小程序码已存在, bookGroupId"+bookGroupId);
return;
}
Long raysClassifyId = null;
BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId);
Long raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId());
if (null != bookAdviserDto) {
raysClassifyId = bookRaysClassifyDao.getClassifyIdByBookTemplateId(bookAdviserDto.getTempletId());
}
if (null == raysClassifyId) {
LOGGER.error("书刊分类没有对应的小睿分类" + bookGroupId);
}
......@@ -4752,6 +4755,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
BeanUtils.copyProperties(bookAppletScene, dto);
}
BookGroupDTO bookGroupDTO = bookGroupDao.getBookBaseInfoById(bookGroupId);
if (bookGroupDTO.getOpenWeapp()) {//1v1走小睿流程
return dto;
} else {
dto.setBookName(StringUtil.addBracket(bookGroupDTO.getBookName()));
//权益
RightsSettingDto rightsSettingDto = rightsSettingBiz.getRightsSettingByBookId4AppletHome(bookGroupDTO.getBookId(), bookGroupDTO.getCreateUser(), bookGroupDTO.getChannelId());
......@@ -4760,6 +4766,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
dto.setRightsSettingIntroduce(rightsSettingDto.getIntroduce());
dto.setRightsSettingCount(rightsSettingDto.getCount());
}
}
return dto;
}
......@@ -4781,13 +4788,16 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
@Override
public void getByAppletScene( Long wechatUserId, String scene ) {
public BookGroupDTO getByAppletScene( Long wechatUserId, String scene ) {
BookGroupDTO dto = new BookGroupDTO();
BookAppletScene bookAppletScene = bookAppletSceneDao.getByAppletId(scene);
if (null == bookAppletScene) {
return;
return dto;
}
if (null != bookAppletScene.getBookGroupId()) {
BookGroupDTO bookGroupDTO = bookGroupDao.getBookBaseInfoById(bookAppletScene.getBookGroupId());
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookAppletScene.getBookGroupId());
BeanUtils.copyProperties(bookGroupDTO, dto);
dto.setAdviserId(bookGroupDTO.getCreateUser());
//用户书刊埋点
AppletUserBookcase appletUserBookcase = new AppletUserBookcase();
appletUserBookcase.setWechatUserId(wechatUserId);
......@@ -4797,6 +4807,10 @@ public class BookGroupBizImpl implements BookGroupBiz {
appletUserBookcaseBiz.addUserBook(appletUserBookcase);
} else if (bookAppletScene.getSceneId() != null) {
QrcodeSceneDto byId = qrcodeSceneConsr.getById(bookAppletScene.getSceneId());
dto.setBookId(byId.getAdviserBookId());
dto.setAdviserId(byId.getCreatedByUserLogin());
dto.setSceneId(bookAppletScene.getSceneId());
dto.setChannelId(byId.getChannelPartyId());
//用户书刊埋点
AppletUserBookcase appletUserBookcase = new AppletUserBookcase();
appletUserBookcase.setWechatUserId(wechatUserId);
......@@ -4804,11 +4818,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
appletUserBookcase.setBookId(byId.getAdviserBookId());
appletUserBookcase.setChannelId(byId.getChannelPartyId());
appletUserBookcaseBiz.addUserBook(appletUserBookcase);
} else {
return;
}
return dto;
}
@Override
......@@ -4991,4 +5002,13 @@ public class BookGroupBizImpl implements BookGroupBiz {
return bookGroupClassifyDao.listPageNew(new PageParam(currentPage,numPerPage),map,"getBookGroupClassifyByAdviserId");
}
@Override
public void updateBookGroupOpenWeapp(Long bookGroupId, Boolean openWeapp) {
if (openWeapp){//开启了,创建小程序码
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookGroupId);
this.createBookGroupAppletUrl(bookGroupId,bookGroupDTO.getBookId(),bookGroupDTO.getChannelId(),bookGroupDTO.getCreateUser());
}
bookGroupDao.updateBookGroupOpenWeapp(bookGroupId, openWeapp);
}
}
......@@ -318,4 +318,8 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
Long getIdByBookNameAndJoinGroupType(String bookName, Integer joinGroupType);
Integer getJoinGroupType(Map<String,Object> map);
/**
* 1V1社群书是否开启小睿流程
*/
void updateBookGroupOpenWeapp(Long bookGroupId, Boolean openWeapp);
}
......@@ -388,4 +388,12 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
public Integer getJoinGroupType(Map<String, Object> map) {
return getSessionTemplate().selectOne(getStatement("getJoinGroupType"),map);
}
@Override
public void updateBookGroupOpenWeapp(Long bookGroupId, Boolean openWeapp) {
Map<String, Object> map = new HashMap<>();
map.put("id", bookGroupId);
map.put("openWeapp", openWeapp);
getSessionTemplate().update(getStatement("updateBookGroupOpenWeapp"), map);
}
}
......@@ -271,6 +271,29 @@ public class BookGroupDTO extends BaseDto {
*/
private String appletUrl;
/**
* 是否开启小睿流程
*/
private Boolean openWeapp;
private Long adviserId;
public Long getAdviserId() {
return adviserId;
}
public void setAdviserId(Long adviserId) {
this.adviserId = adviserId;
}
public Boolean getOpenWeapp() {
return openWeapp;
}
public void setOpenWeapp(Boolean openWeapp) {
this.openWeapp = openWeapp;
}
public String getAppletUrl() {
return appletUrl;
}
......@@ -743,6 +766,9 @@ public class BookGroupDTO extends BaseDto {
", verLabelName='" + verLabelName + '\'' +
", areaLabelName='" + areaLabelName + '\'' +
", friendGuideList=" + friendGuideList +
", appletUrl='" + appletUrl + '\'' +
", openWeapp=" + openWeapp +
", adviserId=" + adviserId +
'}';
}
}
\ No newline at end of file
......@@ -160,13 +160,18 @@ public class BookGroup extends BaseEntity {
* 好友引导语
*/
private List<BookGroupFriendGuide> friendGuideList;
/**
* 是否开启小睿流程
*/
private Boolean openWeapp;
public Long getId() {
return id;
public Boolean getOpenWeapp() {
return openWeapp;
}
public void setId(Long id) {
this.id = id;
public void setOpenWeapp(Boolean openWeapp) {
this.openWeapp = openWeapp;
}
public Long getBookId() {
......@@ -425,6 +430,7 @@ public class BookGroup extends BaseEntity {
", belongSpecialAgent=" + belongSpecialAgent +
", shortBookName='" + shortBookName + '\'' +
", friendGuideList=" + friendGuideList +
", openWeapp=" + openWeapp +
'}';
}
}
\ No newline at end of file
......@@ -720,4 +720,9 @@ public interface BookGroupFacade {
@GetMapping("getBookBaseInfo4Applet")
ResponseDto<?> getBookBaseInfo4Applet(
@RequestParam("adviserId") Long adviserId, @RequestParam("bookId")Long bookId, @RequestParam("channelId")Long channelId);
@ApiOperation("1V1社群书是否开启小睿流程")
@GetMapping("updateBookGroupOpenWeapp")
ResponseDto<?> updateBookGroupOpenWeapp(
@RequestHeader("token") String token, @RequestParam("bookGroupId") Long bookGroupId, @RequestParam("openWeapp") Boolean openWeapp);
}
......@@ -1163,8 +1163,8 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "scene不能为空!");
}
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
bookGroupBiz.getByAppletScene(wechatUserId, scene);
return new ResponseDto<>();
BookGroupDTO bookGroupDTO = bookGroupBiz.getByAppletScene(wechatUserId, scene);
return new ResponseDto<>(bookGroupDTO);
}
@Override
......@@ -1187,4 +1187,13 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(bookGroupBiz.getBookBaseInfo4Applet(adviserId, channelId, bookId));
}
@Override
@GetMapping("updateBookGroupOpenWeapp")
public ResponseDto<?> updateBookGroupOpenWeapp(
@RequestHeader("token") String token, @RequestParam("bookGroupId") Long bookGroupId, @RequestParam("openWeapp") Boolean openWeapp){
SessionUtil.getToken4Redis(token);
bookGroupBiz.updateBookGroupOpenWeapp(bookGroupId,openWeapp);
return new ResponseDto<>();
}
}
......@@ -596,7 +596,7 @@
WHEN 2 THEN bgs.id
WHEN 3 THEN srk.id
WHEN 4 THEN bgs.id
else null END,0)=0,0,1)as has_serve, A.IS_PRINT isPrint
else null END,0)=0,0,1)as has_serve, A.IS_PRINT isPrint, G.open_weapp openWeapp
FROM
book_group G
LEFT 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
......
......@@ -30,6 +30,7 @@
<result column="agent_id" property="agentId" jdbcType="BIGINT"/>
<result column="belong_special_agent" property="belongSpecialAgent" jdbcType="BOOLEAN"/>
<result column="short_book_name" property="shortBookName" jdbcType="VARCHAR"/>
<result column="open_weapp" property="openWeapp" jdbcType="BOOLEAN"/>
</resultMap>
<resultMap id="BookGroupDTO" type="com.pcloud.book.group.dto.BookGroupDTO">
......@@ -65,6 +66,7 @@
<result column="agent_id" property="agentId" jdbcType="BIGINT"/>
<result column="belong_special_agent" property="belongSpecialAgent" jdbcType="BOOLEAN"/>
<result column="short_book_name" property="shortBookName" jdbcType="VARCHAR"/>
<result column="open_weapp" property="openWeapp" jdbcType="BOOLEAN"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -73,7 +75,7 @@
create_time,
update_time, is_delete, is_show_book_name,join_group_type,add_friend_guide,customer_service_name,
is_invite_group,book_group_cipher, last_push_update_time, is_some_update, agent_id, belong_special_agent,
short_book_name
short_book_name, open_weapp
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
......@@ -462,7 +464,8 @@
b.isbn,
bg.channel_id,
bg.create_user,
bg.join_group_type
bg.join_group_type,
bg.open_weapp
FROM
book_group bg
LEFT JOIN book b ON bg.book_id = b.BOOK_ID
......@@ -981,4 +984,11 @@
and is_delete=0
</select>
<update id="updateBookGroupOpenWeapp" parameterType="map">
UPDATE book_group
SET open_weapp = #{openWeapp}
WHERE
id = #{id}
</update>
</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