Commit a95dcf17 by 阮思源

Merge branch 'feat-1002024' into 'master'

C1002024

See merge request rays/pcloud-book!234
parents fc4a271f a94593c9
......@@ -572,6 +572,11 @@ public class BookDto extends BaseDto {
*/
private String bookGroupCipher;
/**
* 是否配置资源
*/
private Boolean hasServe;
public String getQrRemark() {
return qrRemark;
}
......@@ -1528,6 +1533,14 @@ public class BookDto extends BaseDto {
this.bookGroupCipher = bookGroupCipher;
}
public Boolean getHasServe() {
return hasServe;
}
public void setHasServe(Boolean hasServe) {
this.hasServe = hasServe;
}
@Override
public String toString() {
return "BookDto{" +
......@@ -1643,6 +1656,7 @@ public class BookDto extends BaseDto {
", joinGroupType=" + joinGroupType +
", friendsCount=" + friendsCount +
", bookGroupCipher='" + bookGroupCipher + '\'' +
", hasServe=" + hasServe +
"} " + super.toString();
}
}
......@@ -119,6 +119,7 @@ public interface BookGroupFacade {
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "hasServe", value = "结束时间", dataType = "boolean", paramType = "query"),
})
@RequestMapping(value = "listBookGroup4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> listBookGroup4Adviser(@RequestHeader("token") String token,
......@@ -134,7 +135,8 @@ public interface BookGroupFacade {
@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)
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "hasServe", required = false) Boolean hasServe)
throws BizException, PermissionException;
@ApiOperation(value = "获取社群书列表(运营)", httpMethod = "POST")
......
......@@ -170,7 +170,8 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@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)
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "hasServe", required = false) Boolean hasServe)
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -191,6 +192,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
paramMap.put("startDate", startDate + " 00:00:00");
paramMap.put("endDate", endDate + " 23:59:59");
}
paramMap.put("hasServe", hasServe);
PageBean pageBean = bookGroupBiz.listBookGroup4Adviser(paramMap, new PageParam(currentPage, numPerPage), adviserId);
return new ResponseDto<>(pageBean);
}
......
......@@ -55,6 +55,7 @@
<result column="BOOK_GROUP_ID" property="bookGroupId" jdbcType="BIGINT" />
<result column="join_group_type" property="joinGroupType" jdbcType="INTEGER"/>
<result column="book_group_cipher" property="bookGroupCipher" jdbcType="VARCHAR"/>
<result column="has_serve" property="hasServe" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="bookListPageMap" type="bookDto" extends ="bookMap">
......@@ -560,12 +561,17 @@
IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber,
G.update_time LAST_MODIFIED_DATE, G.create_time CREATED_DATE, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl,
G.group_qrcode_name groupQrcodeName, G.dep_label_id depLabelId, G.join_group_type, G.book_group_cipher
, case count(bgs.id)
when 0 then 0
else 1
end has_serve
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
LEFT JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID
LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE
LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME <![CDATA[ > ]]> NOW() AND BF.START_TIME <![CDATA[ < ]]> NOW()
LEFT JOIN BOOK_GROUP_SERVE bgs on G.id=bgs.book_group_id
WHERE
G.create_user = #{adviserId} AND G.is_delete = 0
AND (
......@@ -615,6 +621,12 @@
AND G.join_group_type=#{joinGroupType}
</if>
GROUP BY G.id
<if test="hasServe!=null and hasServe==true">
having count(bgs.id)>0
</if>
<if test="hasServe!=null and hasServe==false">
having count(bgs.id)=0
</if>
ORDER BY
G.UPDATE_TIME DESC
</select>
......
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