Commit ec3feb0f by 阮思源

是否显示书名

parent 1bb9daef
...@@ -214,4 +214,14 @@ public interface BookGroupBiz { ...@@ -214,4 +214,14 @@ public interface BookGroupBiz {
* @param paramMap * @param paramMap
*/ */
void exportGroupQrcode4Adviser(Map<String, Object> paramMap, Long adviserId); void exportGroupQrcode4Adviser(Map<String, Object> paramMap, Long adviserId);
/**
* 更新是否显示书名
*/
void updateIsShowBookName(Boolean isShowBookName, Long partyId);
/**
* 获取是否显示书名
*/
Boolean getIsShowBookName(Long partyId);
} }
...@@ -227,7 +227,15 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -227,7 +227,15 @@ public class BookGroupBizImpl implements BookGroupBiz {
*/ */
@Override @Override
public BookGroupDTO getBookGroupInfo4Wechat(Long bookGroupId) throws BizException { public BookGroupDTO getBookGroupInfo4Wechat(Long bookGroupId) throws BizException {
return bookGroupDao.getDTOById(bookGroupId); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookGroupId);
if (bookGroupDTO != null && bookGroupDTO.getBookId() != null
&& bookGroupDTO.getIsShowBookName() != null && bookGroupDTO.getIsShowBookName()) {
BookDto bookDto = bookDao.getBaseById(bookGroupDTO.getBookId());
if (bookDto != null) {
bookGroupDTO.setBookName(bookDto.getBookName());
}
}
return bookGroupDTO;
} }
/** /**
...@@ -697,4 +705,18 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -697,4 +705,18 @@ public class BookGroupBizImpl implements BookGroupBiz {
}); });
} }
@Transactional(rollbackFor = Exception.class)
@ParamLog("更新是否显示书名")
@Override
public void updateIsShowBookName(Boolean isShowBookName, Long partyId) {
bookGroupDao.updateIsShowBookName(isShowBookName,partyId);
}
@ParamLog("获取是否显示书名")
@Override
public Boolean getIsShowBookName(Long partyId) {
return bookGroupDao.getIsShowBookName(partyId);
}
} }
...@@ -125,4 +125,14 @@ public interface BookGroupDao extends BaseDao<BookGroup> { ...@@ -125,4 +125,14 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* @return * @return
*/ */
List<BookGroupDTO> getBookInfoByIdsWithBookClockInfoId(Map<String,Object> paramMap); List<BookGroupDTO> getBookInfoByIdsWithBookClockInfoId(Map<String,Object> paramMap);
/**
* 更新是否显示书名
*/
void updateIsShowBookName(Boolean isShowBookName, Long partyId);
/**
* 获取是否显示书名
*/
Boolean getIsShowBookName(Long partyId);
} }
...@@ -127,4 +127,17 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou ...@@ -127,4 +127,17 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
public List<BookGroupDTO> getBookInfoByIdsWithBookClockInfoId(Map<String,Object> paramMap) { public List<BookGroupDTO> getBookInfoByIdsWithBookClockInfoId(Map<String,Object> paramMap) {
return this.getSqlSession().selectList(this.getStatement("getBookInfoByIdsWithBookClockInfoId"), paramMap); return this.getSqlSession().selectList(this.getStatement("getBookInfoByIdsWithBookClockInfoId"), paramMap);
} }
@Override
public void updateIsShowBookName(Boolean isShowBookName, Long partyId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("isShowBookName", isShowBookName);
paramMap.put("partyId", partyId);
super.getSqlSession().update(getStatement("updateIsShowBookName"), paramMap);
}
@Override
public Boolean getIsShowBookName(Long partyId) {
return this.getSqlSession().selectOne(this.getStatement("getIsShowBookName"), partyId);
}
} }
...@@ -132,6 +132,11 @@ public class BookGroupDTO extends BaseDto { ...@@ -132,6 +132,11 @@ public class BookGroupDTO extends BaseDto {
private Long bookClockInfoId; private Long bookClockInfoId;
/**
* 是否显示书名
*/
private Boolean isShowBookName;
public String getUrl() { public String getUrl() {
return url; return url;
} }
...@@ -334,6 +339,14 @@ public class BookGroupDTO extends BaseDto { ...@@ -334,6 +339,14 @@ public class BookGroupDTO extends BaseDto {
this.bookClockInfoId = bookClockInfoId; this.bookClockInfoId = bookClockInfoId;
} }
public Boolean getIsShowBookName() {
return isShowBookName;
}
public void setIsShowBookName(Boolean isShowBookName) {
this.isShowBookName = isShowBookName;
}
@Override @Override
public String toString() { public String toString() {
return "BookGroupDTO{" + return "BookGroupDTO{" +
...@@ -362,6 +375,7 @@ public class BookGroupDTO extends BaseDto { ...@@ -362,6 +375,7 @@ public class BookGroupDTO extends BaseDto {
", bookName='" + bookName + '\'' + ", bookName='" + bookName + '\'' +
", url='" + url + '\'' + ", url='" + url + '\'' +
", bookClockInfoId=" + bookClockInfoId + ", bookClockInfoId=" + bookClockInfoId +
'}'; ", isShowBookName='" + isShowBookName + '\'' +
"} " + super.toString();
} }
} }
\ No newline at end of file
...@@ -97,6 +97,11 @@ public class BookGroup extends BaseEntity { ...@@ -97,6 +97,11 @@ public class BookGroup extends BaseEntity {
*/ */
private Boolean isDelete; private Boolean isDelete;
/**
* 是否展示书名
*/
private Boolean isShowBookName;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -233,6 +238,14 @@ public class BookGroup extends BaseEntity { ...@@ -233,6 +238,14 @@ public class BookGroup extends BaseEntity {
this.sceneId = sceneId; this.sceneId = sceneId;
} }
public Boolean getIsShowBookName() {
return isShowBookName;
}
public void setIsShowBookName(Boolean isShowBookName) {
this.isShowBookName = isShowBookName;
}
@Override @Override
public String toString() { public String toString() {
return "BookGroup{" + return "BookGroup{" +
...@@ -253,6 +266,7 @@ public class BookGroup extends BaseEntity { ...@@ -253,6 +266,7 @@ public class BookGroup extends BaseEntity {
", createTime=" + createTime + ", createTime=" + createTime +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", isDelete=" + isDelete + ", isDelete=" + isDelete +
'}'; ", isShowBookName=" + isShowBookName +
"} " + super.toString();
} }
} }
\ No newline at end of file
...@@ -224,4 +224,18 @@ public interface BookGroupFacade { ...@@ -224,4 +224,18 @@ public interface BookGroupFacade {
@RequestParam(value = "endDate", required = false) String endDate) @RequestParam(value = "endDate", required = false) String endDate)
throws BizException, PermissionException; throws BizException, PermissionException;
@ApiOperation("更新是否显示书名")
@GetMapping("updateIsShowBookName")
ResponseDto<?> updateIsShowBookName(
@RequestHeader("token") String token,
@RequestParam("isShowBookName") Boolean isShowBookName
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取是否显示书名")
@GetMapping("getIsShowBookName")
ResponseDto<?> getIsShowBookName(
@RequestHeader("token") String token
) throws BizException, PermissionException, JsonParseException;
} }
...@@ -318,4 +318,29 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -318,4 +318,29 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
bookGroupBiz.exportGroupQrcode4Adviser(paramMap, adviserId); bookGroupBiz.exportGroupQrcode4Adviser(paramMap, adviserId);
return new ResponseDto<>(); return new ResponseDto<>();
} }
@ApiOperation("更新是否显示书名")
@GetMapping("updateIsShowBookName")
@Override
public ResponseDto<?> updateIsShowBookName(
@RequestHeader("token") String token,
@RequestParam("isShowBookName") Boolean isShowBookName
) throws BizException, PermissionException, JsonParseException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (isShowBookName == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "isShowBookName不能为空!");
}
bookGroupBiz.updateIsShowBookName(isShowBookName, partyId);
return new ResponseDto<>();
}
@ApiOperation("获取是否显示书名")
@GetMapping("getIsShowBookName")
@Override
public ResponseDto<?> getIsShowBookName(
@RequestHeader("token") String token
) throws BizException, PermissionException, JsonParseException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupBiz.getIsShowBookName(partyId));
}
} }
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="is_delete" property="isDelete" jdbcType="BIT"/> <result column="is_delete" property="isDelete" jdbcType="BIT"/>
<result column="is_show_book_name" property="isShowBookName" jdbcType="BOOLEAN"/>
</resultMap> </resultMap>
<resultMap id="BookGroupDTO" type="com.pcloud.book.group.dto.BookGroupDTO"> <resultMap id="BookGroupDTO" type="com.pcloud.book.group.dto.BookGroupDTO">
...@@ -41,12 +42,13 @@ ...@@ -41,12 +42,13 @@
<result column="isbn" property="isbn" jdbcType="VARCHAR"/> <result column="isbn" property="isbn" jdbcType="VARCHAR"/>
<result column="BOOK_NAME" property="bookName" jdbcType="VARCHAR"/> <result column="BOOK_NAME" property="bookName" jdbcType="VARCHAR"/>
<result column="book_clock_info_id" property="bookClockInfoId" jdbcType="BIGINT"/> <result column="book_clock_info_id" property="bookClockInfoId" jdbcType="BIGINT"/>
<result column="is_show_book_name" property="isShowBookName" jdbcType="BOOLEAN"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, book_id, channel_id, group_qrcode_url, group_qrcode_name, pro_label_id, dep_label_id, id, book_id, channel_id, group_qrcode_url, group_qrcode_name, pro_label_id, dep_label_id,
pur_label_id, join_title, join_slogan, personal_qrcode_url, product_id, create_user, create_time, pur_label_id, join_title, join_slogan, personal_qrcode_url, product_id, create_user, create_time,
update_time, is_delete update_time, is_delete, is_show_book_name
</sql> </sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long"> <select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
...@@ -297,4 +299,17 @@ ...@@ -297,4 +299,17 @@
${item} ${item}
</foreach> </foreach>
</select> </select>
<!--更新是否显示书名-->
<update id="updateIsShowBookName" parameterType="map">
update book_group set
is_show_book_name=#{isShowBookName}
where create_user=#{partyId}
</update>
<!--获取是否显示书名-->
<select id="getIsShowBookName" parameterType="Long" resultType="Boolean">
select IFNULL(is_show_book_name,0) from book_group
where create_user=#{partyId} limit 1
</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