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