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
c92e4e0d
Commit
c92e4e0d
authored
Aug 08, 2019
by
郑永强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
早晚报公众号选择
parent
d87b70b1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
134 additions
and
22 deletions
+134
-22
AdNewsBiz.java
...k/src/main/java/com/pcloud/book/adnews/biz/AdNewsBiz.java
+1
-1
AdNewsBizImpl.java
...n/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
+8
-5
AdNewsWechatChooseDao.java
...ava/com/pcloud/book/adnews/dao/AdNewsWechatChooseDao.java
+2
-0
AdNewsWechatChooseDaoImpl.java
...cloud/book/adnews/dao/impl/AdNewsWechatChooseDaoImpl.java
+7
-0
AdNewsFacade.java
...main/java/com/pcloud/book/adnews/facade/AdNewsFacade.java
+37
-6
AdNewsFacadeImpl.java
.../com/pcloud/book/adnews/facade/impl/AdNewsFacadeImpl.java
+69
-9
AdNewsWechatChooseMapper.xml
...main/resources/mapper/adnews/AdNewsWechatChooseMapper.xml
+9
-0
AdNewsWechatMapper.xml
...k/src/main/resources/mapper/adnews/AdNewsWechatMapper.xml
+1
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/AdNewsBiz.java
View file @
c92e4e0d
...
...
@@ -56,7 +56,7 @@ public interface AdNewsBiz {
Long
addAdNewsWechat
(
AdNewsWechat
adNewsWechat
);
/**
* 获取公众号列表
* 获取
所有的
公众号列表
* @param currentPage
* @param numPerPage
* @return
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
View file @
c92e4e0d
...
...
@@ -387,11 +387,14 @@ public class AdNewsBizImpl implements AdNewsBiz {
adNewsWechatChoose
.
setUpdateUser
(
partyId
);
adNewsWechatChooses
.
add
(
adNewsWechatChoose
);
}
//校验重复添加
Integer
count
=
adNewsWechatChooseDao
.
getCountByAdNewsWechatIdsAndPartyId
(
adNewsWechatIds
,
partyId
);
if
(
count
>
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请勿重复添加!"
);
}
// //校验重复添加
// Integer count = adNewsWechatChooseDao.getCountByAdNewsWechatIdsAndPartyId(adNewsWechatIds, partyId);
// if (count > 0) {
// throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请勿重复添加!");
// }
// 移除编辑之前的选择
adNewsWechatChooseDao
.
deleteAdNewsWechatChooseByPartyId
(
partyId
);
// 重新建立关系
adNewsWechatChooseDao
.
batchInsert
(
adNewsWechatChooses
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsWechatChooseDao.java
View file @
c92e4e0d
...
...
@@ -16,5 +16,7 @@ public interface AdNewsWechatChooseDao extends BaseDao<AdNewsWechatChoose> {
void
deleteAdNewsWechatChooseById
(
Long
adNewsWechatId
,
Long
partyId
);
void
deleteAdNewsWechatChooseByPartyId
(
Long
partyId
);
Integer
getCountByAdNewsWechatIdsAndPartyId
(
List
<
Long
>
adNewsIds
,
Long
partyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/impl/AdNewsWechatChooseDaoImpl.java
View file @
c92e4e0d
...
...
@@ -30,6 +30,13 @@ public class AdNewsWechatChooseDaoImpl extends BaseDaoImpl<AdNewsWechatChoose> i
}
@Override
public
void
deleteAdNewsWechatChooseByPartyId
(
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"partyId"
,
partyId
);
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteAdNewsWechatChooseByPartyId"
),
map
);
}
@Override
public
Integer
getCountByAdNewsWechatIdsAndPartyId
(
List
<
Long
>
adNewsWechatIds
,
Long
partyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adNewsWechatIds"
,
adNewsWechatIds
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/facade/AdNewsFacade.java
View file @
c92e4e0d
package
com
.
pcloud
.
book
.
adnews
.
facade
;
import
com.pcloud.book.adnews.entity.AdNewsSet
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -12,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
@FeignClient
(
value
=
"pcloud-service-book"
,
qualifier
=
"adNewsFacadeCloud"
,
path
=
"adNews"
)
@FeignClient
(
value
=
"pcloud-service-book"
,
qualifier
=
"adNewsFacadeCloud"
,
path
=
"adNews"
)
@Api
(
description
=
"推送群消息外部接口"
)
public
interface
AdNewsFacade
{
...
...
@@ -54,7 +56,7 @@ public interface AdNewsFacade {
@GetMapping
(
"/getAdNewsList"
)
ResponseDto
<?>
getAdNewsList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
...
...
@@ -63,8 +65,8 @@ public interface AdNewsFacade {
@GetMapping
(
"/getAdNewsChooseList"
)
ResponseDto
<?>
getAdNewsChooseList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"hasUsed"
,
required
=
false
)
@ApiParam
(
"标题"
)
Boolean
hasUsed
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"hasUsed"
,
required
=
false
)
@ApiParam
(
"标题"
)
Boolean
hasUsed
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
...
...
@@ -74,7 +76,36 @@ public interface AdNewsFacade {
@PostMapping
(
"/addAdNewsWechat"
)
ResponseDto
<?>
addAdNewsWechat
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"wechatName"
)
@ApiParam
(
"公众号id/微信号"
)
String
wechatName
)
throws
BizException
,
PermissionException
;
@RequestParam
(
value
=
"wechatName"
)
@ApiParam
(
"公众号名称"
)
String
wechatName
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"添加编辑选择的公众号"
)
@PostMapping
(
"/createAdNewsWechatChooseBatch"
)
ResponseDto
<?>
createAdNewsWechatChooseBatch
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"选择的公众号主键"
)
List
<
Long
>
adNewsWechatIds
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"移除编辑已选择的公众号"
)
@PostMapping
(
"/deleteAdNewsWechatChoose"
)
ResponseDto
<?>
deleteAdNewsWechatChoose
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"adNewsWechatId"
)
@ApiParam
(
"公众号主键"
)
Long
adNewsWechatId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取编辑已选择的公众号"
)
@GetMapping
(
"/getAdNewsWechatChooseList"
)
ResponseDto
<?>
getAdNewsWechatChooseList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取所有的公众号列表"
)
@GetMapping
(
"/getAdNewsWechatList"
)
ResponseDto
<?>
getAdNewsWechatList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/facade/impl/AdNewsFacadeImpl.java
View file @
c92e4e0d
...
...
@@ -85,10 +85,10 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
@RequestBody
@ApiParam
(
"新闻id集合"
)
List
<
Long
>
adNewsIds
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
ListUtils
.
isEmpty
(
adNewsIds
)){
if
(
ListUtils
.
isEmpty
(
adNewsIds
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
adNewsBiz
.
createAdNewsChooseBatch
(
adNewsIds
,
partyId
);
adNewsBiz
.
createAdNewsChooseBatch
(
adNewsIds
,
partyId
);
return
new
ResponseDto
<>();
}
...
...
@@ -112,7 +112,7 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
@Override
public
ResponseDto
<?>
getAdNewsList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
...
...
@@ -123,7 +123,7 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
if
(
numPerPage
==
null
||
numPerPage
<=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"每页条数不能为空且必须大于0!"
);
}
return
new
ResponseDto
<>(
adNewsBiz
.
getAdNewsList
(
title
,
partyId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
adNewsBiz
.
getAdNewsList
(
title
,
partyId
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"获取编辑选择的早晚报素材库"
)
...
...
@@ -131,8 +131,8 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
@Override
public
ResponseDto
<?>
getAdNewsChooseList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"hasUsed"
,
required
=
false
)
@ApiParam
(
"使用状态"
)
Boolean
hasUsed
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
@ApiParam
(
"标题"
)
String
title
,
@RequestParam
(
value
=
"hasUsed"
,
required
=
false
)
@ApiParam
(
"使用状态"
)
Boolean
hasUsed
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
...
...
@@ -152,9 +152,69 @@ public class AdNewsFacadeImpl implements AdNewsFacade {
public
ResponseDto
<?>
addAdNewsWechat
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"wechatName"
)
@ApiParam
(
"公众号id/微信号"
)
String
wechatName
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
AdNewsWechat
adNewsWechat
=
new
AdNewsWechat
(
null
,
wechatName
,
partyId
,
false
);
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
AdNewsWechat
adNewsWechat
=
new
AdNewsWechat
(
null
,
wechatName
,
partyId
,
false
);
return
new
ResponseDto
<>(
adNewsBiz
.
addAdNewsWechat
(
adNewsWechat
));
}
@ApiOperation
(
"添加编辑选择的公众号"
)
@PostMapping
(
"/createAdNewsWechatChooseBatch"
)
@Override
public
ResponseDto
<?>
createAdNewsWechatChooseBatch
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"选择的公众号主键"
)
List
<
Long
>
adNewsWechatIds
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
adNewsBiz
.
createAdNewsWechatChooseBatch
(
adNewsWechatIds
,
partyId
);
return
new
ResponseDto
<>();
}
@Override
@ApiOperation
(
"移除编辑已选择的公众号"
)
@PostMapping
(
"/deleteAdNewsWechatChoose"
)
public
ResponseDto
<?>
deleteAdNewsWechatChoose
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"adNewsWechatId"
)
@ApiParam
(
"公众号主键"
)
Long
adNewsWechatId
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
adNewsBiz
.
deleteAdNewsWechatChoose
(
adNewsWechatId
,
partyId
);
return
new
ResponseDto
<>();
}
@Override
@ApiOperation
(
"获取编辑已选择的公众号"
)
@GetMapping
(
"/getAdNewsWechatChooseList"
)
public
ResponseDto
<?>
getAdNewsWechatChooseList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
currentPage
==
null
||
currentPage
<
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前页不能为空且不能小于0!"
);
}
if
(
numPerPage
==
null
||
numPerPage
<=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"每页条数不能为空且必须大于0!"
);
}
return
new
ResponseDto
<>(
adNewsBiz
.
getAdNewsWechatChooseList
(
partyId
,
currentPage
,
numPerPage
));
}
@Override
@ApiOperation
(
"获取所有的公众号列表"
)
@GetMapping
(
"/getAdNewsWechatList"
)
public
ResponseDto
<?>
getAdNewsWechatList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
currentPage
==
null
||
currentPage
<
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前页不能为空且不能小于0!"
);
}
if
(
numPerPage
==
null
||
numPerPage
<=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"每页条数不能为空且必须大于0!"
);
}
return
new
ResponseDto
<>(
adNewsBiz
.
getAdNewsWechatList
(
currentPage
,
numPerPage
));
}
}
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsWechatChooseMapper.xml
View file @
c92e4e0d
...
...
@@ -100,6 +100,15 @@
where ad_news_wechat_id=#{adNewsWechatId}
</update>
<!--根据编辑id删除-->
<update
id=
"deleteAdNewsWechatChooseByPartyId"
parameterType=
"map"
>
update ad_news_wechat_choose set
is_delete=1,
update_user=#{partyId},
update_time=now()
where adviser_id=#{partyId}
</update>
<!--根据条件获取数量-->
<select
id=
"getCountByAdNewsWechatIdsAndPartyId"
parameterType=
"map"
resultType=
"Integer"
>
select count(1) from ad_news_wechat_choose where
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsWechatMapper.xml
View file @
c92e4e0d
...
...
@@ -43,7 +43,7 @@
a.update_time
FROM
ad_news_wechat a
LEFT JOIN ad_news_wechat_choose b ON b.ad_news_wechat_id = b
.id
INNER JOIN ad_news_wechat_choose b ON b.ad_news_wechat_id = a
.id
AND b.is_delete = 0
AND b.adviser_id = #{partyId}
WHERE
...
...
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