Commit 1c03d6fa by 田超

Merge branch 'feature/wxworkLimit' into 'master'

feat: [1004234] 企业微信群与书对应,一群一书

See merge request rays/pcloud-book!1177
parents d0336181 60c73470
...@@ -301,4 +301,9 @@ public interface BookService { ...@@ -301,4 +301,9 @@ public interface BookService {
@ApiOperation("书刊保底支持") @ApiOperation("书刊保底支持")
@PostMapping("mapBookMinimunSupport") @PostMapping("mapBookMinimunSupport")
ResponseEntity<ResponseDto<Map<Long, BookMinimumSupportDTO4Service>>> mapBookMinimunSupport(@RequestBody List<Long> bookIds); ResponseEntity<ResponseDto<Map<Long, BookMinimumSupportDTO4Service>>> mapBookMinimunSupport(@RequestBody List<Long> bookIds);
@ApiOperation("查本书外已被勾选的群id")
@GetMapping("getWxworkGroupQrcodeIdsExceptBook")
ResponseEntity<ResponseDto<List<Long>>> getWxworkGroupQrcodeIdsExceptBook(@RequestParam(value = "sceneId", required = false) Long sceneId,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId);
} }
...@@ -45,4 +45,12 @@ public interface BookQrcodeWxworkBiz { ...@@ -45,4 +45,12 @@ public interface BookQrcodeWxworkBiz {
* * @param null * * @param null
*/ */
List<BookQrcodeWxworkResponseVO> getWxworkQrcodeInfoByBook4Rays(Long bookId, Long channelId, Long adviserId, Integer wxworkQrcodeType); List<BookQrcodeWxworkResponseVO> getWxworkQrcodeInfoByBook4Rays(Long bookId, Long channelId, Long adviserId, Integer wxworkQrcodeType);
/**
* 查本书外已被勾选的群id
* @author:zhuyajie
* @date:2021/1/27 15:40
* * @param null
*/
List<Long> getWxworkGroupQrcodeIdsExceptBook(Long sceneId, Long bookGroupId);
} }
...@@ -28,7 +28,6 @@ import java.util.ArrayList; ...@@ -28,7 +28,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @ClassName com.pcloud.book.book.biz.impl.BookQrcodeWxworkBizImpl * @ClassName com.pcloud.book.book.biz.impl.BookQrcodeWxworkBizImpl
...@@ -214,4 +213,25 @@ public class BookQrcodeWxworkBizImpl implements BookQrcodeWxworkBiz { ...@@ -214,4 +213,25 @@ public class BookQrcodeWxworkBizImpl implements BookQrcodeWxworkBiz {
} }
return wxworkResponseVOS; return wxworkResponseVOS;
} }
@Override
public List<Long> getWxworkGroupQrcodeIdsExceptBook(Long sceneId, Long bookGroupId) {
if (null == sceneId && null == bookGroupId) {
return new ArrayList<>();
}
Integer wxworkQrcodeType = WxworkQrcodeType.GROUP_QRCODE.getCode();
Long bookId;
if (null != sceneId) {
QrcodeSceneDto qrcodeSceneDto = qrcodeSceneConsr.getById(sceneId);
bookId = qrcodeSceneDto == null ? null : qrcodeSceneDto.getAdviserBookId();
} else {
BookGroupDTO bookGroupDTO = bookGroupDao.getBookBaseInfoById(bookGroupId);
bookId = bookGroupDTO == null ? null : bookGroupDTO.getBookId();
}
if (null == bookId) {
return new ArrayList<>();
}
List<Long> groupQrcodeIds = bookQrcodeWxworkDao.getWxworkQrcodeIdsExceptBook(bookId, wxworkQrcodeType);
return groupQrcodeIds;
}
} }
...@@ -37,4 +37,12 @@ public interface BookQrcodeWxworkDao extends BaseDao<BookQrcodeWxwork>{ ...@@ -37,4 +37,12 @@ public interface BookQrcodeWxworkDao extends BaseDao<BookQrcodeWxwork>{
* * @param null * * @param null
*/ */
List<BookQrcodeWxwork> getWxworkQrcodeByBook(Long bookId, Long channelId, Long adviserId, Integer wxworkQrcodeType); List<BookQrcodeWxwork> getWxworkQrcodeByBook(Long bookId, Long channelId, Long adviserId, Integer wxworkQrcodeType);
/**
* 除本书外被勾选的二维码id
* @author:zhuyajie
* @date:2021/1/27 15:48
* * @param null
*/
List<Long> getWxworkQrcodeIdsExceptBook(Long bookId, Integer wxworkQrcodeType);
} }
\ No newline at end of file
...@@ -47,4 +47,12 @@ public class BookQrcodeWxworkDaoImpl extends BaseDaoImpl<BookQrcodeWxwork> imple ...@@ -47,4 +47,12 @@ public class BookQrcodeWxworkDaoImpl extends BaseDaoImpl<BookQrcodeWxwork> imple
map.put("wxworkQrcodeType", wxworkQrcodeType); map.put("wxworkQrcodeType", wxworkQrcodeType);
return getSessionTemplate().selectList(getStatement("getWxworkQrcodeByBook"), map); return getSessionTemplate().selectList(getStatement("getWxworkQrcodeByBook"), map);
} }
@Override
public List<Long> getWxworkQrcodeIdsExceptBook(Long bookId, Integer wxworkQrcodeType) {
Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId);
map.put("wxworkQrcodeType", wxworkQrcodeType);
return getSessionTemplate().selectList(getStatement("getWxworkQrcodeIdsExceptBook"), map);
}
} }
...@@ -275,4 +275,11 @@ public class BookServiceImpl implements BookService { ...@@ -275,4 +275,11 @@ public class BookServiceImpl implements BookService {
public ResponseEntity<ResponseDto<Map<Long, BookMinimumSupportDTO4Service>>> mapBookMinimunSupport(@RequestBody List<Long> bookIds){ public ResponseEntity<ResponseDto<Map<Long, BookMinimumSupportDTO4Service>>> mapBookMinimunSupport(@RequestBody List<Long> bookIds){
return ResponseHandleUtil.toResponse(bookMinimumSupportBiz.mapBookMinimunSupport(bookIds)); return ResponseHandleUtil.toResponse(bookMinimumSupportBiz.mapBookMinimunSupport(bookIds));
} }
@Override
@GetMapping("getWxworkGroupQrcodeIdsExceptBook")
public ResponseEntity<ResponseDto<List<Long>>> getWxworkGroupQrcodeIdsExceptBook(@RequestParam(value = "sceneId", required = false) Long sceneId,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId) {
return ResponseHandleUtil.toResponse(bookQrcodeWxworkBiz.getWxworkGroupQrcodeIdsExceptBook(sceneId, bookGroupId));
}
} }
...@@ -97,4 +97,14 @@ ...@@ -97,4 +97,14 @@
order by wxwork_qrcode_type asc, create_time desc order by wxwork_qrcode_type asc, create_time desc
</select> </select>
<select id="getWxworkQrcodeIdsExceptBook" resultType="long" parameterType="map">
SELECT DISTINCT
wxwork_qrcode_id
FROM
book_qrcode_wxwork
WHERE
wxwork_qrcode_type = #{wxworkQrcodeType}
AND book_id != #{bookId}
</select>
</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