Commit 29853702 by 朱亚洁

feat:[1006950]图书sop

parent 8dec5ad8
...@@ -8,7 +8,6 @@ import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO; ...@@ -8,7 +8,6 @@ import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.advertising.advertising.dto.AdvertisingSpaceItemDTO; import com.pcloud.advertising.advertising.dto.AdvertisingSpaceItemDTO;
import com.pcloud.analysisengine.browse.dto.BrowseRecordStatisticDTO; import com.pcloud.analysisengine.browse.dto.BrowseRecordStatisticDTO;
import com.pcloud.appcenter.app.dto.AppDto; import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.appcenter.app.dto.AppRaysDTO;
import com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO; import com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO;
import com.pcloud.appcenter.app.dto.AppRaysDTO; import com.pcloud.appcenter.app.dto.AppRaysDTO;
import com.pcloud.book.applet.biz.AppletBooklistBiz; import com.pcloud.book.applet.biz.AppletBooklistBiz;
...@@ -431,13 +430,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -431,13 +430,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
bookAppletScene.setAccountSettingId(BookProps.getMiniOfficialAccountsId()); bookAppletScene.setAccountSettingId(BookProps.getMiniOfficialAccountsId());
bookAppletSceneDao.insert(bookAppletScene); bookAppletSceneDao.insert(bookAppletScene);
} }
//同一本书其他码下关闭小睿流程 //同一本书其他码下关闭小睿流程,查出要关闭的资源页,然后更新
resourcePageDao.setOtherPageRaysClose(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), sceneId, null); List<ResourcePage> otherPageRaysOpen = resourcePageDao.getOtherPageRaysOpen(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), sceneId, null);
//为了维护缓存。要先查出来其他码。然后更新 //删除修改过的二维码缓存
List<ResourcePage> otherPageRaysClose = resourcePageDao.getOtherPageRaysClose(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), sceneId, null); if(CollUtil.isNotEmpty(otherPageRaysOpen)){
if(CollUtil.isNotEmpty(otherPageRaysClose)){ otherPageRaysOpen.forEach(e->{
otherPageRaysClose.forEach(e->{ delResourcePageToRedis(e);
addResourcePageToRedis(e); ResourcePage page = new ResourcePage();
page.setId(e.getId());
page.setOpenRays(0);
resourcePageDao.update(page);
}); });
} }
} else { } else {
...@@ -467,11 +469,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -467,11 +469,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private void delResourcePageToRedis(ResourcePage resourcePage) { private void delResourcePageToRedis(ResourcePage resourcePage) {
if(null!=resourcePage.getSceneId()) { if(null!=resourcePage.getSceneId()) {
JedisClusterUtils.hdel(BookConstant.RESOURCE_PAGE_BY_SCENE_ID,resourcePage.getSceneId().toString()); JedisClusterUtils.hdel(BookConstant.RESOURCE_PAGE_BY_SCENE_ID,resourcePage.getSceneId().toString());
qrcodeSceneConsr.deleteParseRedis(resourcePage.getSceneId(),null); ThreadPoolUtils.OTHER_THREAD_POOL.execute(()->qrcodeSceneConsr.deleteParseRedis(resourcePage.getSceneId(),null));
} }
if(null!=resourcePage.getBookGroupId()) { if(null!=resourcePage.getBookGroupId()) {
JedisClusterUtils.hdel(BookConstant.RESOURCE_PAGE_BY_BOOK_GROUP_ID,resourcePage.getBookGroupId().toString()); JedisClusterUtils.hdel(BookConstant.RESOURCE_PAGE_BY_BOOK_GROUP_ID,resourcePage.getBookGroupId().toString());
qrcodeSceneConsr.deleteParseRedis(null,resourcePage.getBookGroupId()); ThreadPoolUtils.OTHER_THREAD_POOL.execute(()->qrcodeSceneConsr.deleteParseRedis(null,resourcePage.getBookGroupId()));
} }
} }
...@@ -534,13 +536,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -534,13 +536,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
bookAppletScene.setAccountSettingId(BookProps.getMiniOfficialAccountsId()); bookAppletScene.setAccountSettingId(BookProps.getMiniOfficialAccountsId());
bookAppletSceneDao.insert(bookAppletScene); bookAppletSceneDao.insert(bookAppletScene);
} }
//同一本书其他码下关闭小睿流程 //同一本书其他码下关闭小睿流程,查出要关闭的资源页,然后更新
resourcePageDao.setOtherPageRaysClose(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), null, bookGroupId); List<ResourcePage> otherPageRaysOpen = resourcePageDao.getOtherPageRaysOpen(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), null, bookGroupId);
//为了维护缓存。要先查出来其他码。然后更新 //删除修改过的二维码缓存
List<ResourcePage> otherPageRaysClose = resourcePageDao.getOtherPageRaysClose(resourcePage.getBookId(), resourcePage.getChannelId(), resourcePage.getCreateUser(), null, bookGroupId); if(CollUtil.isNotEmpty(otherPageRaysOpen)){
if(CollUtil.isNotEmpty(otherPageRaysClose)){ otherPageRaysOpen.forEach(e->{
otherPageRaysClose.forEach(e->{ delResourcePageToRedis(e);
addResourcePageToRedis(e); ResourcePage page = new ResourcePage();
page.setId(e.getId());
page.setOpenRays(0);
resourcePageDao.update(page);
}); });
} }
} else { } else {
......
...@@ -129,4 +129,6 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -129,4 +129,6 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
Long getBookIdByBookGroupId(Long bookGroupId); Long getBookIdByBookGroupId(Long bookGroupId);
Long getBookIdBySceneId(Long sceneId); Long getBookIdBySceneId(Long sceneId);
List<ResourcePage> getOtherPageRaysOpen(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId);
} }
...@@ -176,4 +176,15 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -176,4 +176,15 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
public Long getBookIdBySceneId(Long sceneId) { public Long getBookIdBySceneId(Long sceneId) {
return getSessionTemplate().selectOne(getStatement("getBookIdBySceneId"), sceneId); return getSessionTemplate().selectOne(getStatement("getBookIdBySceneId"), sceneId);
} }
@Override
public List<ResourcePage> getOtherPageRaysOpen(Long bookId, Long channelId, Long createUser, Long sceneId, Long bookGroupId) {
Map<String, Object> map = new HashMap<>();
map.put("bookId", bookId);
map.put("channelId", channelId);
map.put("createUser", createUser);
map.put("bookGroupId", bookGroupId);
map.put("sceneId", sceneId);
return getSessionTemplate().selectList(getStatement("getOtherPageRaysOpen"), map);
}
} }
...@@ -372,4 +372,20 @@ ...@@ -372,4 +372,20 @@
limit 1 limit 1
</select> </select>
<select id="getOtherPageRaysOpen" parameterType="map" resultMap="ResourcePageMap">
select
<include refid="Base_Column_List"/>
from resource_page
WHERE
book_id = #{bookId}
AND channel_id = #{channelId}
AND create_user = #{createUser}
and open_rays = 1
<if test="sceneId != null">
AND scene_id != #{sceneId}
</if>
<if test="bookGroupId != null">
AND book_group_id != #{bookGroupId}
</if>
</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