Commit 7f1df465 by 吴博

Merge branch 'feature/1007915' into 'release'

feat: [1007915] 编辑运营需求(高级设置、书刊目录、题库、课文诵读、ERP、视频)

See merge request rays/pcloud-book!1669
parents 3802db35 adfda392
...@@ -148,4 +148,9 @@ public class BookAdviserDto extends BaseDto { ...@@ -148,4 +148,9 @@ public class BookAdviserDto extends BaseDto {
* 是否跳转本书 * 是否跳转本书
*/ */
private Integer isJumpBook; private Integer isJumpBook;
/**
* 是否开启教辅必备大礼包
*/
private Integer openGiftBag;
} }
...@@ -893,6 +893,20 @@ public class BookDto extends BaseDto { ...@@ -893,6 +893,20 @@ public class BookDto extends BaseDto {
*/ */
private Integer isFreeze; private Integer isFreeze;
/**
* 是否k12书籍
* @return
*/
private Integer isK12;
public Integer getIsK12() {
return isK12;
}
public void setIsK12(Integer isK12) {
this.isK12 = isK12;
}
public Integer getIsFreeze() { public Integer getIsFreeze() {
return isFreeze; return isFreeze;
} }
......
...@@ -523,4 +523,8 @@ public interface BookAdviserBiz { ...@@ -523,4 +523,8 @@ public interface BookAdviserBiz {
PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp4ES(String isbn, String uniqueNumber, String adviserName, Long agentId, Integer currentPage, Integer numPerPage); PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp4ES(String isbn, String uniqueNumber, String adviserName, Long agentId, Integer currentPage, Integer numPerPage);
Integer getBookCreateCount(Long adviserId, String startTime); Integer getBookCreateCount(Long adviserId, String startTime);
void updateOpenGiftBag(Long bookId, Long adviserId, Long channelId, Integer isOpenGiftBag);
Integer getOpenGiftBag(Long sceneId, Long bookId, Long adviserId, Long channelId);
} }
...@@ -3799,4 +3799,50 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -3799,4 +3799,50 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Integer count = bookAdviserDao.getBookCreateCount(adviserId,startTime); Integer count = bookAdviserDao.getBookCreateCount(adviserId,startTime);
return count; return count;
} }
@Override
public void updateOpenGiftBag(Long bookId, Long adviserId, Long channelId, Integer isOpenGiftBag) {
if (ObjectUtil.hasEmpty(bookId,adviserId,channelId,isOpenGiftBag)) {
throw new BizException(BizException.PARAM_IS_NULL.getCode(), "缺少参数!");
}
bookAdviserDao.updateOpenGiftBag(bookId, adviserId, channelId, isOpenGiftBag);
}
@Override
public Integer getOpenGiftBag(Long sceneId, Long bookId, Long adviserId, Long channelId) {
if(null == sceneId && null == bookId && null == adviserId && null == channelId) {
return null;
}
Integer result=null;
BookAdviserDto base=null;
if (null != bookId) {
base = bookAdviserDao.getBase(bookId, channelId, adviserId);
} else if (null != sceneId) {
//根据sceneId获取二维码信息
Map<Long, QrcodeSceneDto> qrcodeSceneDtoMap = qrcodeSceneConsr.listBaseInfoByIds(Lists.newArrayList(sceneId));
if (MapUtils.isEmpty(qrcodeSceneDtoMap) || null == qrcodeSceneDtoMap.get(sceneId)) {
return result;
}
QrcodeSceneDto qrcodeSceneDto = qrcodeSceneDtoMap.get(sceneId);
if (null == qrcodeSceneDto || null == qrcodeSceneDto.getAdviserBookId()) {
return result;
}
base = bookAdviserDao.getBase(qrcodeSceneDto.getAdviserBookId(),qrcodeSceneDto.getChannelPartyId(), qrcodeSceneDto.getCreatedByUserLogin());
}
if(null==base){
return null;
}
result=base.getOpenGiftBag();
if(null==result){
//就是没有设置过,没有设置过。如果是k12的默认打开
if (CollUtil.toList(RightsSettingConstant.K12_TEMPLET_ID_NEW).contains(base.getTempletId())) {
bookAdviserDao.updateOpenGiftBag(base.getBookId(), base.getAdviserId(), base.getChannelId(), 1);
result=1;
} else {
bookAdviserDao.updateOpenGiftBag(base.getBookId(), base.getAdviserId(), base.getChannelId(), 0);
result=0;
}
}
return result;
}
} }
...@@ -847,7 +847,8 @@ public class BookBizImpl implements BookBiz { ...@@ -847,7 +847,8 @@ public class BookBizImpl implements BookBiz {
bookSet.setErpNumbers(bookDto); bookSet.setErpNumbers(bookDto);
// 尝试加载创建人(ERP运维人员) // 尝试加载创建人(ERP运维人员)
bookSet.setUploadUserId(bookDto); bookSet.setUploadUserId(bookDto);
// 设置是否k12书刊
bookSet.setIsK12(bookDto);
return bookDto; return bookDto;
} }
......
...@@ -361,4 +361,8 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> { ...@@ -361,4 +361,8 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> {
Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId); Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId);
Integer getBookCreateCount(Long adviserId, String startTime); Integer getBookCreateCount(Long adviserId, String startTime);
void updateOpenGiftBag(Long bookId, Long adviserId, Long channelId, Integer isOpenGiftBag);
Integer getOpenGiftBag(Long bookId, Long adviserId, Long channelId);
} }
...@@ -564,4 +564,23 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book ...@@ -564,4 +564,23 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book
paramMap.put("startTime", startTime); paramMap.put("startTime", startTime);
return getSessionTemplate().selectOne(getStatement("getBookCreateCount"), paramMap); return getSessionTemplate().selectOne(getStatement("getBookCreateCount"), paramMap);
} }
@Override
public void updateOpenGiftBag(Long bookId, Long adviserId, Long channelId, Integer isOpenGiftBag) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId",bookId);
paramMap.put("channelId", channelId);
paramMap.put("adviserId", adviserId);
paramMap.put("isOpenGiftBag", isOpenGiftBag);
getSessionTemplate().update(getStatement("updateOpenGiftBag"), paramMap);
}
@Override
public Integer getOpenGiftBag(Long bookId, Long adviserId, Long channelId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId",bookId);
paramMap.put("channelId", channelId);
paramMap.put("adviserId", adviserId);
return getSessionTemplate().selectOne(getStatement("getOpenGiftBag"), paramMap);
}
} }
...@@ -606,4 +606,29 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade { ...@@ -606,4 +606,29 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
bookAdviserBiz.updateOpenRaysCode(bookAdviser); bookAdviserBiz.updateOpenRaysCode(bookAdviser);
return new ResponseDto<>(); return new ResponseDto<>();
} }
/**
* 设置是否开启教辅必备大礼包
*/
@RequestMapping(value = "updateOpenGiftBag", method = RequestMethod.GET)
public ResponseDto<?> updateOpenGiftBag(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "isOpenGiftBag") Integer isOpenGiftBag
) throws PermissionException {
Long adviserId = (Long)SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookAdviserBiz.updateOpenGiftBag(bookId, adviserId, channelId, isOpenGiftBag);
return new ResponseDto<>();
}
/**
* 查看是否开启教辅必备大礼包
*/
@RequestMapping(value = "getOpenGiftBag", method = RequestMethod.GET)
public ResponseDto<?> getOpenGiftBag(@RequestParam(value = "sceneId",required = false) Long sceneId,
@RequestParam(value = "bookId",required = false) Long bookId,
@RequestParam(value = "adviserId",required = false) Long adviserId,
@RequestParam(value = "channelId", required = false) Long channelId) throws PermissionException {
return new ResponseDto<>(bookAdviserBiz.getOpenGiftBag(sceneId,bookId, adviserId, channelId));
}
} }
...@@ -63,6 +63,7 @@ import com.pcloud.book.group.dao.BookGroupDao; ...@@ -63,6 +63,7 @@ import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupServeCountDTO; import com.pcloud.book.group.dto.BookGroupServeCountDTO;
import com.pcloud.book.group.dto.BookGroupStatisticDTO; import com.pcloud.book.group.dto.BookGroupStatisticDTO;
import com.pcloud.book.rightsSetting.constants.RightsSettingConstant;
import com.pcloud.book.util.common.ThreadPoolUtils; import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.channelcenter.base.constants.ChannelConstants; import com.pcloud.channelcenter.base.constants.ChannelConstants;
import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum; import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum;
...@@ -91,6 +92,7 @@ import com.pcloud.contentcenter.resource.dto.ResourceDTO; ...@@ -91,6 +92,7 @@ import com.pcloud.contentcenter.resource.dto.ResourceDTO;
import com.pcloud.data.domain.enums.YesNoEnum; import com.pcloud.data.domain.enums.YesNoEnum;
import com.pcloud.data.domain.vo.AllAdviserBookStatisVO; import com.pcloud.data.domain.vo.AllAdviserBookStatisVO;
import com.pcloud.labelcenter.label.service.LabelService; import com.pcloud.labelcenter.label.service.LabelService;
import com.pcloud.readercenter.common.enums.YesOrNoNumEnum;
import com.pcloud.resourcecenter.product.dto.ProductDto; import com.pcloud.resourcecenter.product.dto.ProductDto;
import com.pcloud.resourcecenter.product.dto.ProductTypeDto; import com.pcloud.resourcecenter.product.dto.ProductTypeDto;
import com.pcloud.resourcecenter.product.dto.SpecificationDto; import com.pcloud.resourcecenter.product.dto.SpecificationDto;
...@@ -2220,4 +2222,12 @@ public class BookSet { ...@@ -2220,4 +2222,12 @@ public class BookSet {
} }
} }
} }
public void setIsK12(BookDto bookDto) {
if (CollUtil.toList(RightsSettingConstant.K12_TEMPLET_ID_NEW).contains(bookDto.getTempletId())) {
bookDto.setIsK12(YesOrNoNumEnum.YES.getValue());
} else {
bookDto.setIsK12(YesOrNoNumEnum.NO.getValue());
}
}
} }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<result column="pur_label_id" property="purLabelId" jdbcType="BIGINT" /> <result column="pur_label_id" property="purLabelId" jdbcType="BIGINT" />
<result column="is_open_catalog" property="isOpenCatalog" jdbcType="BIT" /> <result column="is_open_catalog" property="isOpenCatalog" jdbcType="BIT" />
<result column="is_jump_book" property="isJumpBook" jdbcType="TINYINT" /> <result column="is_jump_book" property="isJumpBook" jdbcType="TINYINT" />
<result column="open_gift_bag" property="openGiftBag" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="manageAdviserMap" type="adviserManageDto" > <resultMap id="manageAdviserMap" type="adviserManageDto" >
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
BOOK_ADVISER_ID, BOOK_ID, TEMPLET_ID, CHANNEL_ID, ADVISER_ID, IS_DELETE, BOOK_ADVISER_ID, BOOK_ID, TEMPLET_ID, CHANNEL_ID, ADVISER_ID, IS_DELETE,
TEMPLET_ID,SECOND_TEMPLET_ID,third_templet_id, TEMPLET_ID,SECOND_TEMPLET_ID,third_templet_id,
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,is_open_robot_process,vol_label_id, GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,is_open_robot_process,vol_label_id,
is_open_catalog, pur_label_id, dep_label_id, pro_label_id, is_jump_book is_open_catalog, pur_label_id, dep_label_id, pro_label_id, is_jump_book,open_gift_bag
FROM FROM
BOOK_ADVISER BOOK_ADVISER
WHERE WHERE
...@@ -1443,4 +1444,39 @@ ...@@ -1443,4 +1444,39 @@
AND CREATED_DATE > #{startTime} AND CREATED_DATE > #{startTime}
</if> </if>
</select> </select>
<update id="updateOpenGiftBag" parameterType="map">
update
book_adviser
set
open_gift_bag = #{isOpenGiftBag},
last_modified_date = NOW()
where
book_id = #{bookId, jdbcType=BIGINT}
AND
adviser_id = #{adviserId, jdbcType=BIGINT}
AND
channel_id = #{channelId, jdbcType=BIGINT}
and
is_delete = 0
</update>
<select id="getOpenGiftBag" parameterType="map" resultType="Integer">
select
open_gift_bag
from
book_adviser
where
book_id = #{bookId}
<if test="adviserId != null">
and adviser_id = #{adviserId}
</if>
<if test="channelId != null">
and channel_id = #{channelId}
</if>
and
is_delete = 0
limit 1
</select>
</mapper> </mapper>
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