Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
13d05208
Commit
13d05208
authored
Oct 18, 2019
by
高鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1001857' into 'master'
ID1001857社群码配置服务不限制渠道 See merge request rays/pcloud-book!205
parents
b382a120
05feca4c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
1 deletions
+104
-1
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+4
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+5
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+53
-1
BookGroupServeDao.java
...ain/java/com/pcloud/book/group/dao/BookGroupServeDao.java
+4
-0
BookGroupServeDaoImpl.java
...com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
+15
-0
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+8
-0
BookGroupServe.xml
...e-book/src/main/resources/mapper/group/BookGroupServe.xml
+15
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
13d05208
...
@@ -109,4 +109,8 @@ public interface BookGroupService {
...
@@ -109,4 +109,8 @@ public interface BookGroupService {
@GetMapping
(
"fillSelfBookGroupCipher"
)
@GetMapping
(
"fillSelfBookGroupCipher"
)
void
fillSelfBookGroupCipher
();
void
fillSelfBookGroupCipher
();
@ApiOperation
(
"将之前的配置资源取的社群码运营更新为应用本身的运营"
)
@GetMapping
(
"dealBookGroupServerChannel"
)
void
dealBookGroupServerChannel
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
13d05208
...
@@ -454,4 +454,9 @@ public interface BookGroupBiz {
...
@@ -454,4 +454,9 @@ public interface BookGroupBiz {
* 补充1v1旧数据的暗号
* 补充1v1旧数据的暗号
*/
*/
void
fillSelfBookGroupCipher
();
void
fillSelfBookGroupCipher
();
/**
* 将之前的配置资源取的社群码运营更新为应用本身的运营
*/
void
dealBookGroupServerChannel
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
13d05208
...
@@ -2152,6 +2152,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2152,6 +2152,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
}
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
dto
.
getChannelId
());
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
dto
.
getChannelId
());
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
if
(
"APP"
.
equalsIgnoreCase
(
bookGroupServe
.
getServeType
()))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
bookGroupServe
.
getServeId
());
if
(
appDto
!=
null
)
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
}
}
// 处理链接地址
// 处理链接地址
String
endUrl
=
bookGroupServe
.
getServeUrl
()
+
"&book_group_id="
+
bookGroupId
;
String
endUrl
=
bookGroupServe
.
getServeUrl
()
+
"&book_group_id="
+
bookGroupId
;
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
...
@@ -2241,7 +2247,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2241,7 +2247,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
@ParamLog
(
"校验字段"
)
@ParamLog
(
"校验字段"
)
private
void
checkBookGroupServe
(
List
<
BookGroupServe
>
bookGroupServes
){
private
void
checkBookGroupServe
(
List
<
BookGroupServe
>
bookGroupServes
){
if
(
ListUtils
.
isEmpty
(
bookGroupServes
))
{
if
(
ListUtils
.
isEmpty
(
bookGroupServes
))
{
return
;
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空!"
)
;
}
}
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
if
(
bookGroupServe
==
null
)
{
if
(
bookGroupServe
==
null
)
{
...
@@ -2262,6 +2268,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2262,6 +2268,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"批量更新资源配置"
)
@ParamLog
(
"批量更新资源配置"
)
@Override
@Override
public
void
batchUpdateBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
)
{
public
void
batchUpdateBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
)
{
...
@@ -2309,6 +2316,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2309,6 +2316,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
// 处理链接地址
// 处理链接地址
String
endUrl
=
bookGroupServe
.
getServeUrl
()
+
"&book_group_id="
+
bookGroupId
;
String
endUrl
=
bookGroupServe
.
getServeUrl
()
+
"&book_group_id="
+
bookGroupId
;
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
bookGroup
.
getChannelId
());
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
bookGroup
.
getChannelId
());
if
(
"APP"
.
equalsIgnoreCase
(
bookGroupServe
.
getServeType
()))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
bookGroupServe
.
getServeId
());
if
(
appDto
!=
null
)
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
}
}
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
//转短链
//转短链
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
linkUrl
);
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
linkUrl
);
...
@@ -2337,6 +2350,45 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2337,6 +2350,45 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
}
}
}
@ParamLog
(
"将之前的配置资源取的社群码运营更新为应用本身的运营"
)
@Override
public
void
dealBookGroupServerChannel
()
{
List
<
BookGroupServe
>
bookGroupServes
=
bookGroupServeDao
.
getListByServerType
(
"APP"
);
if
(
ListUtils
.
isEmpty
(
bookGroupServes
))
{
return
;
}
List
<
Long
>
appIds
=
new
ArrayList
<>();
List
<
Long
>
bookGroupIds
=
new
ArrayList
<>();
for
(
BookGroupServe
bookGroupServe:
bookGroupServes
){
if
(!
appIds
.
contains
(
bookGroupServe
.
getServeId
())){
appIds
.
add
(
bookGroupServe
.
getServeId
());
}
if
(!
bookGroupIds
.
contains
(
bookGroupServe
.
getBookGroupId
())){
bookGroupIds
.
add
(
bookGroupServe
.
getBookGroupId
());
}
}
Map
<
Long
,
AppDto
>
appDtoMap
=
appConsr
.
getBaseByIds
(
appIds
);
List
<
BookGroupDTO
>
bookGroupDTOList
=
bookGroupDao
.
getDTOByIds
(
bookGroupIds
);
Map
<
Long
,
BookGroupDTO
>
bookGroupMap
=
new
HashMap
<>();
for
(
BookGroupDTO
bookGroupDTO:
bookGroupDTOList
){
bookGroupMap
.
put
(
bookGroupDTO
.
getId
(),
bookGroupDTO
);
}
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
AppDto
appDto
=
appDtoMap
.
get
(
bookGroupServe
.
getServeId
());
BookGroupDTO
bookGroupDTO
=
bookGroupMap
.
get
(
bookGroupServe
.
getBookGroupId
());
if
(
appDto
!=
null
&&
bookGroupDTO
!=
null
&&
!
appDto
.
getChannelId
().
equals
(
bookGroupDTO
.
getChannelId
()))
{
//换链接
String
endUrl
=
bookGroupServe
.
getServeUrl
()
+
"&book_group_id="
+
bookGroupServe
.
getBookGroupId
();
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
//转短链
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
linkUrl
);
bookGroupServeDao
.
updateShortUrl
(
bookGroupServe
.
getId
(),
resultUrl
);
}
}
}
@ParamLog
(
"生成暗号"
)
@ParamLog
(
"生成暗号"
)
private
String
createBookGroupCipher
(){
private
String
createBookGroupCipher
(){
//生成暗号规则:abc1234,前三位小写字母,后四位数字
//生成暗号规则:abc1234,前三位小写字母,后四位数字
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupServeDao.java
View file @
13d05208
...
@@ -11,4 +11,8 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
...
@@ -11,4 +11,8 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
);
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
);
void
deleteByBookGroupId
(
Long
bookGroupId
);
void
deleteByBookGroupId
(
Long
bookGroupId
);
List
<
BookGroupServe
>
getListByServerType
(
String
serveType
);
void
updateShortUrl
(
Long
id
,
String
shortUrl
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
View file @
13d05208
...
@@ -5,7 +5,9 @@ import com.pcloud.book.group.entity.BookGroupServe;
...
@@ -5,7 +5,9 @@ import com.pcloud.book.group.entity.BookGroupServe;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Description
* @Description
...
@@ -28,4 +30,17 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
...
@@ -28,4 +30,17 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
public
void
deleteByBookGroupId
(
Long
bookGroupId
)
{
public
void
deleteByBookGroupId
(
Long
bookGroupId
)
{
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByBookGroupId"
),
bookGroupId
);
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByBookGroupId"
),
bookGroupId
);
}
}
@Override
public
List
<
BookGroupServe
>
getListByServerType
(
String
serveType
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByServerType"
),
serveType
);
}
@Override
public
void
updateShortUrl
(
Long
id
,
String
shortUrl
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
id
);
map
.
put
(
"shortUrl"
,
shortUrl
);
super
.
getSqlSession
().
update
(
getStatement
(
"updateShortUrl"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
13d05208
...
@@ -183,4 +183,12 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -183,4 +183,12 @@ public class BookGroupServiceImpl implements BookGroupService {
bookGroupBiz
.
fillSelfBookGroupCipher
();
bookGroupBiz
.
fillSelfBookGroupCipher
();
}
}
@ApiOperation
(
"将之前的配置资源取的社群码运营更新为应用本身的运营"
)
@GetMapping
(
"dealBookGroupServerChannel"
)
@Override
public
void
dealBookGroupServerChannel
()
{
bookGroupBiz
.
dealBookGroupServerChannel
();
}
}
}
pcloud-service-book/src/main/resources/mapper/group/BookGroupServe.xml
View file @
13d05208
...
@@ -82,4 +82,18 @@
...
@@ -82,4 +82,18 @@
delete from book_group_serve
delete from book_group_serve
where book_group_id=#{bookGroupId}
where book_group_id=#{bookGroupId}
</delete>
</delete>
<!--根据类型查询集合-->
<select
id=
"getListByServerType"
parameterType=
"String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group_serve
where serve_type=#{serveType}
</select>
<!--根据id更新短链-->
<update
id=
"updateShortUrl"
parameterType=
"map"
>
update book_group_serve set
short_url=#{shortUrl}
where id=#{id}
</update>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment