Commit 49799711 by 高鹏

Merge branch 'feat-1001847' into 'master'

【ID1001847】1v1模式和普通群模式tab分开

See merge request rays/pcloud-book!199
parents 54ae084e 52240603
......@@ -321,7 +321,7 @@ public class BookAppealBizImpl implements BookAppealBiz {
// 社群书申诉创建社群码
if (null != bookAppealDto && bookAppealDto.getIsBookGroup()) {
bookGroupBiz.recoverByBookId(bookId, channelId, appealAdviserId);
bookGroupBiz.getBookGroupInfoByBookId(bookId, channelId, appealAdviserId, bookAppealDto.getAddType(), null);
bookGroupBiz.getBookGroupInfoByBookId(bookId, channelId, appealAdviserId, bookAppealDto.getAddType(), null, null);
}
// 修改申诉状态
this.updateAppealState(auditUser, bookMainAdviserDto.getAppealState(), bookMainAdviserDto.getVersion(),
......
......@@ -57,7 +57,7 @@ public interface BookGroupBiz {
* @param adviserId 编辑ID
* @throws BizException
*/
BookGroup createBookGroupAfterCreateBook(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId) throws BizException;
BookGroup createBookGroupAfterCreateBook(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId, Integer joinGroupType) throws BizException;
/**
* 获取社群书群二维码信息
......@@ -96,7 +96,7 @@ public interface BookGroupBiz {
* @return
* @throws BizException
*/
BookGroupDTO getBookGroupInfoByBookId(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId) throws BizException;
BookGroupDTO getBookGroupInfoByBookId(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId, Integer joinGroupType) throws BizException;
/**
* 更新群二维码信息
......
......@@ -250,7 +250,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
@Override
@ParamLog("创建社群书时生成群二维码")
@Transactional(rollbackFor = Exception.class)
public BookGroup createBookGroupAfterCreateBook(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId) throws BizException {
public BookGroup createBookGroupAfterCreateBook(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId, Integer joinGroupType) throws BizException {
BookGroup bookGroup = new BookGroup();
bookGroup.setBookId(bookId);
bookGroup.setChannelId(channelId);
......@@ -274,12 +274,18 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookGroup.setGroupQrcodeUrl(groupQrcodeVO.getQrcodeUrl());
bookGroup.setSceneId(groupQrcodeVO.getSceneId());
bookGroupDao.insert(bookGroup);
if (joinGroupType != null) {
bookGroupDao.updateJoinGroupType(bookGroup.getId(), joinGroupType);
}
} else {
bookGroupDao.insert(bookGroup);
String groupQrcodeUrl = QrcodeUtils.createWithMargin(bookGroupQrcodeDomain + "/" + bookGroup.getId(), 1);
BookGroup group = new BookGroup();
group.setId(bookGroup.getId());
group.setGroupQrcodeUrl(groupQrcodeUrl);
if (joinGroupType != null) {
group.setJoinGroupType(joinGroupType);
}
bookGroupDao.update(group);
bookGroup.setGroupQrcodeUrl(groupQrcodeUrl);
}
......@@ -394,13 +400,13 @@ public class BookGroupBizImpl implements BookGroupBiz {
* 获取社群书群二维码信息
*/
@Override
public BookGroupDTO getBookGroupInfoByBookId(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId) throws BizException {
public BookGroupDTO getBookGroupInfoByBookId(Long bookId, Long channelId, Long adviserId, Integer addType, Long sceneId, Integer joinGroupType) throws BizException {
BookGroupDTO bookGroupDTO = null;
if (!bookId.equals(0L)) {
bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId);
}
if (null == bookGroupDTO) {
BookGroup bookGroup = this.createBookGroupAfterCreateBook(bookId, channelId, adviserId, addType, sceneId);
BookGroup bookGroup = this.createBookGroupAfterCreateBook(bookId, channelId, adviserId, addType, sceneId, joinGroupType);
bookGroupDTO = new BookGroupDTO();
bookGroupDTO.setId(bookGroup.getId());
bookGroupDTO.setBookId(bookId);
......
......@@ -191,4 +191,9 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* 更新暗号
*/
void updateCipher(Long id, String bookGroupCipher);
/**
* 更新入群方式
*/
void updateJoinGroupType(Long id, Integer joinGroupType);
}
......@@ -199,4 +199,12 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
paramMap.put("bookGroupCipher", bookGroupCipher);
super.getSqlSession().update(getStatement("updateCipher"), paramMap);
}
@Override
public void updateJoinGroupType(Long id, Integer joinGroupType) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("id", id);
paramMap.put("joinGroupType", joinGroupType);
super.getSqlSession().update(getStatement("updateJoinGroupType"), paramMap);
}
}
......@@ -68,7 +68,8 @@ public interface BookGroupFacade {
@RequestMapping(value = "getBookGroupInfoByBookId", method = RequestMethod.GET)
ResponseDto<?> getBookGroupInfoByBookId(@RequestHeader("token") String token, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "addType", required = false) Integer addType, @RequestParam(value = "sceneId", required = false) Long sceneId) throws BizException, PermissionException, JsonParseException;
@RequestParam(value = "addType", required = false) Integer addType, @RequestParam(value = "sceneId", required = false) Long sceneId,
@RequestParam(value = "joinGroupType", required = false) Integer joinGroupType) throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "是否有社群码", httpMethod = "GET")
@ApiImplicitParams({
......@@ -127,6 +128,7 @@ public interface BookGroupFacade {
@RequestParam(value = "isMainEditor", required = false) Integer isMainEditor,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "bookId", required = false) Integer bookId,
@RequestParam(value = "joinGroupType", required = false) Integer joinGroupType,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate)
throws BizException, PermissionException;
......
......@@ -94,12 +94,14 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
public ResponseDto<?> getBookGroupInfoByBookId(@RequestHeader("token") String token, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "addType", required = false) Integer addType,
@RequestParam(value = "sceneId", required = false) Long sceneId) throws BizException, PermissionException, JsonParseException {
@RequestParam(value = "sceneId", required = false) Long sceneId,
@RequestParam(value = "joinGroupType", required = false) Integer joinGroupType
) throws BizException, PermissionException, JsonParseException {
if (null == bookId || null == channelId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupBiz.getBookGroupInfoByBookId(bookId, channelId, adviserId, addType, sceneId));
return new ResponseDto<>(bookGroupBiz.getBookGroupInfoByBookId(bookId, channelId, adviserId, addType, sceneId, joinGroupType));
}
/**
......@@ -160,6 +162,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestParam(value = "isMainEditor", required = false) Integer isMainEditor,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "bookId", required = false) Integer bookId,
@RequestParam(value = "joinGroupType", required = false) Integer joinGroupType,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate)
throws BizException, PermissionException {
......@@ -177,6 +180,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName);
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("bookId", bookId);
paramMap.put("joinGroupType", joinGroupType);
if (!StringUtil.isEmpty(startDate) && !StringUtil.isEmpty(endDate)) {
paramMap.put("startDate", startDate + " 00:00:00");
paramMap.put("endDate", endDate + " 23:59:59");
......
......@@ -611,6 +611,9 @@
<if test="startDate != null and endDate != null">
AND G.create_time BETWEEN #{startDate} AND #{endDate}
</if>
<if test="joinGroupType !=null">
AND G.join_group_type=#{joinGroupType}
</if>
GROUP BY G.id
ORDER BY
G.UPDATE_TIME DESC
......
......@@ -474,4 +474,12 @@
update_time=now()
where id=#{id}
</update>
<!--更新入群方式-->
<update id="updateJoinGroupType" parameterType="map">
update book_group set
join_group_type = #{joinGroupType},
update_time=now()
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