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
2a5abfd9
Commit
2a5abfd9
authored
Dec 02, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1006126' into 'master'
feat: [1006126] 广告管理CPA模块优化 See merge request rays/pcloud-book!1469
parents
df01a0a7
0ec8d56b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
222 additions
and
23 deletions
+222
-23
BmBiz.java
.../src/main/java/com/pcloud/book/advertising/biz/BmBiz.java
+13
-1
BmBizImpl.java
.../java/com/pcloud/book/advertising/biz/impl/BmBizImpl.java
+76
-3
BmRegisterDao.java
...n/java/com/pcloud/book/advertising/dao/BmRegisterDao.java
+2
-0
BmRegisterItemDao.java
...va/com/pcloud/book/advertising/dao/BmRegisterItemDao.java
+2
-0
BmRegisterDaoImpl.java
...m/pcloud/book/advertising/dao/impl/BmRegisterDaoImpl.java
+7
-1
BmRegisterItemDaoImpl.java
...loud/book/advertising/dao/impl/BmRegisterItemDaoImpl.java
+10
-0
AdvertisingBmRegister.java
...pcloud/book/advertising/entity/AdvertisingBmRegister.java
+13
-0
AdvertisingBmRegisterItem.java
...ud/book/advertising/entity/AdvertisingBmRegisterItem.java
+13
-0
BmFacade.java
...ain/java/com/pcloud/book/advertising/facade/BmFacade.java
+3
-1
BmFacadeImpl.java
...com/pcloud/book/advertising/facade/impl/BmFacadeImpl.java
+37
-10
AdvertisingBmRegisterItemMapper.xml
...es/mapper/advertising/AdvertisingBmRegisterItemMapper.xml
+19
-2
AdvertisingBmRegisterMapper.xml
...ources/mapper/advertising/AdvertisingBmRegisterMapper.xml
+27
-5
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/BmBiz.java
View file @
2a5abfd9
...
@@ -73,6 +73,12 @@ public interface BmBiz {
...
@@ -73,6 +73,12 @@ public interface BmBiz {
* @return
* @return
*/
*/
Long
userSubmit
(
AdvertisingBmRegister
bmRegister
,
Long
wechatUserId
);
Long
userSubmit
(
AdvertisingBmRegister
bmRegister
,
Long
wechatUserId
);
/**
* 通过cpa链接预览提交
*/
Long
userSubmit4Cpa
(
AdvertisingBmRegister
bmRegister
,
Long
wechatUserId
);
/**
/**
* 微信端获取个人报名详情
* 微信端获取个人报名详情
* @param adId 应用ID
* @param adId 应用ID
...
@@ -80,7 +86,7 @@ public interface BmBiz {
...
@@ -80,7 +86,7 @@ public interface BmBiz {
* @return
* @return
* @throws BizException
* @throws BizException
*/
*/
List
<
BmRegisterDTO
>
getDetail4Wechat
(
Long
adId
,
Long
wechatUserId
,
Long
qrcodeId
)
throws
BizException
;
List
<
BmRegisterDTO
>
getDetail4Wechat
(
Long
adId
,
Long
wechatUserId
,
Long
qrcodeId
,
Long
cpaId
)
throws
BizException
;
/**
/**
* 获取报名次数
* 获取报名次数
...
@@ -127,4 +133,10 @@ public interface BmBiz {
...
@@ -127,4 +133,10 @@ public interface BmBiz {
* @return
* @return
*/
*/
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
/**
* cpa内容管理报名信息导出
* @param cpaId
*/
Map
<
String
,
Object
>
exportRegisterInfoByCpaId
(
Long
cpaId
,
String
statisMonth
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/BmBizImpl.java
View file @
2a5abfd9
package
com
.
pcloud
.
book
.
advertising
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
advertising
.
biz
.
impl
;
import
com.pcloud.book.advertising.biz.BmBiz
;
import
com.pcloud.book.advertising.biz.BmBiz
;
import
com.pcloud.book.advertising.dao.AdvertisingCpaDao
;
import
com.pcloud.book.advertising.dao.AdvertisingDistributionBookDao
;
import
com.pcloud.book.advertising.dao.AdvertisingDistributionBookDao
;
import
com.pcloud.book.advertising.dao.AdvertisingSpaceDao
;
import
com.pcloud.book.advertising.dao.AdvertisingSpaceDao
;
import
com.pcloud.book.advertising.dao.BmOptionDao
;
import
com.pcloud.book.advertising.dao.BmOptionDao
;
...
@@ -15,6 +16,7 @@ import com.pcloud.book.advertising.entity.AdvertisingBmOption;
...
@@ -15,6 +16,7 @@ import com.pcloud.book.advertising.entity.AdvertisingBmOption;
import
com.pcloud.book.advertising.entity.AdvertisingBmOptionItem
;
import
com.pcloud.book.advertising.entity.AdvertisingBmOptionItem
;
import
com.pcloud.book.advertising.entity.AdvertisingBmRegister
;
import
com.pcloud.book.advertising.entity.AdvertisingBmRegister
;
import
com.pcloud.book.advertising.entity.AdvertisingBmRegisterItem
;
import
com.pcloud.book.advertising.entity.AdvertisingBmRegisterItem
;
import
com.pcloud.book.advertising.entity.AdvertisingCpa
;
import
com.pcloud.book.advertising.entity.AdvertisingDistributionBook
;
import
com.pcloud.book.advertising.entity.AdvertisingDistributionBook
;
import
com.pcloud.book.advertising.entity.AdvertisingSpace
;
import
com.pcloud.book.advertising.entity.AdvertisingSpace
;
import
com.pcloud.book.advertising.enums.AdPositionEnum
;
import
com.pcloud.book.advertising.enums.AdPositionEnum
;
...
@@ -87,6 +89,8 @@ public class BmBizImpl implements BmBiz {
...
@@ -87,6 +89,8 @@ public class BmBizImpl implements BmBiz {
private
ChannelConsr
channelConsr
;
private
ChannelConsr
channelConsr
;
@Autowired
@Autowired
private
AdvertisingDistributionBookDao
distributionBookDao
;
private
AdvertisingDistributionBookDao
distributionBookDao
;
@Autowired
private
AdvertisingCpaDao
advertisingCpaDao
;
/**
/**
* 获取报名商品选项类型
* 获取报名商品选项类型
...
@@ -302,7 +306,37 @@ public class BmBizImpl implements BmBiz {
...
@@ -302,7 +306,37 @@ public class BmBizImpl implements BmBiz {
bmRegisterDao
.
insert
(
bmRegister
);
bmRegisterDao
.
insert
(
bmRegister
);
Long
registerId
=
bmRegister
.
getId
();
Long
registerId
=
bmRegister
.
getId
();
// 添加用户选项
// 添加用户选项
addRegisterItem
(
items
,
adId
,
wechatUserId
,
registerId
);
addRegisterItem
(
items
,
adId
,
wechatUserId
,
registerId
,
null
);
return
registerId
;
}
@Override
public
Long
userSubmit4Cpa
(
AdvertisingBmRegister
bmRegister
,
Long
wechatUserId
)
{
// 检测参数
Long
cpaId
=
bmRegister
.
getCpaId
();
List
<
AdvertisingBmRegisterItem
>
items
=
bmRegister
.
getBmRegisterItemList
();
if
(
ListUtils
.
isEmpty
(
items
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请填写表单"
);
}
Long
mobilePhoneOptionId
=
bmOptionDao
.
getMobilePhoneOptionIdByCPA
(
cpaId
);
Optional
<
AdvertisingBmRegisterItem
>
itemOptional
=
items
.
stream
().
filter
(
s
->
s
!=
null
&&
s
.
getOptionId
()
==
mobilePhoneOptionId
).
findFirst
();
if
(
itemOptional
.
isPresent
())
{
// 存在
AdvertisingBmRegisterItem
registerItem
=
itemOptional
.
get
();
if
(
null
!=
registerItem
&&
!
StringUtil
.
isEmpty
(
registerItem
.
getOptionValue
()))
{
Integer
count
=
bmRegisterItemDao
.
checkMobilePhone4Cpa
(
cpaId
,
bmRegister
.
getFromType
(),
bmRegister
.
getFromId
(),
registerItem
.
getOptionValue
());
if
(
count
>
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"手机号已存在"
);
}
}
}
Long
agentId
=
channelConsr
.
getParentId
(
bmRegister
.
getChannelId
());
bmRegister
.
setAgentId
(
agentId
);
WechatUser
wechat
=
readerConsr
.
getWechatUser
(
wechatUserId
);
bmRegister
.
setNickName
(
wechat
==
null
?
""
:
wechat
.
getWechatUserNickname
());
bmRegisterDao
.
insert
(
bmRegister
);
Long
registerId
=
bmRegister
.
getId
();
// 添加用户选项
addRegisterItem
(
items
,
null
,
wechatUserId
,
registerId
,
cpaId
);
return
registerId
;
return
registerId
;
}
}
...
@@ -314,13 +348,14 @@ public class BmBizImpl implements BmBiz {
...
@@ -314,13 +348,14 @@ public class BmBizImpl implements BmBiz {
* @param registerId
* @param registerId
* @throws BizException
* @throws BizException
*/
*/
public
void
addRegisterItem
(
List
<
AdvertisingBmRegisterItem
>
items
,
Long
adId
,
Long
wechatUserId
,
Long
registerId
)
throws
BizException
{
public
void
addRegisterItem
(
List
<
AdvertisingBmRegisterItem
>
items
,
Long
adId
,
Long
wechatUserId
,
Long
registerId
,
Long
cpaId
)
throws
BizException
{
if
(
ListUtils
.
isEmpty
(
items
))
{
if
(
ListUtils
.
isEmpty
(
items
))
{
return
;
return
;
}
}
for
(
AdvertisingBmRegisterItem
item
:
items
)
{
for
(
AdvertisingBmRegisterItem
item
:
items
)
{
item
.
setUserId
(
wechatUserId
);
item
.
setUserId
(
wechatUserId
);
item
.
setAdId
(
adId
);
item
.
setAdId
(
adId
);
item
.
setCpaId
(
cpaId
);
item
.
setRegisterId
(
registerId
);
item
.
setRegisterId
(
registerId
);
//多选单选选项id
//多选单选选项id
List
<
Long
>
optionItems
=
item
.
getOptionItemIds
();
List
<
Long
>
optionItems
=
item
.
getOptionItemIds
();
...
@@ -345,11 +380,12 @@ public class BmBizImpl implements BmBiz {
...
@@ -345,11 +380,12 @@ public class BmBizImpl implements BmBiz {
* 微信端获取个人报名详情
* 微信端获取个人报名详情
*/
*/
@Override
@Override
public
List
<
BmRegisterDTO
>
getDetail4Wechat
(
Long
adId
,
Long
wechatUserId
,
Long
qrcodeId
)
throws
BizException
{
public
List
<
BmRegisterDTO
>
getDetail4Wechat
(
Long
adId
,
Long
wechatUserId
,
Long
qrcodeId
,
Long
cpaId
)
throws
BizException
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
paramMap
.
put
(
"qrcodeId"
,
qrcodeId
);
paramMap
.
put
(
"qrcodeId"
,
qrcodeId
);
paramMap
.
put
(
"cpaId"
,
cpaId
);
List
<
BmRegisterDTO
>
result
=
bmRegisterDao
.
getDetailByUser
(
paramMap
);
List
<
BmRegisterDTO
>
result
=
bmRegisterDao
.
getDetailByUser
(
paramMap
);
return
result
;
return
result
;
...
@@ -523,4 +559,41 @@ public class BmBizImpl implements BmBiz {
...
@@ -523,4 +559,41 @@ public class BmBizImpl implements BmBiz {
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
return
bmRegisterDao
.
getRegisterCountByBookId
(
bookId
,
adviserId
,
channelId
,
adId
,
statisMonth
);
return
bmRegisterDao
.
getRegisterCountByBookId
(
bookId
,
adviserId
,
channelId
,
adId
,
statisMonth
);
}
}
@Override
public
Map
<
String
,
Object
>
exportRegisterInfoByCpaId
(
Long
cpaId
,
String
statisMonth
)
{
AdvertisingCpa
cpa
=
advertisingCpaDao
.
getById
(
cpaId
);
if
(
null
==
cpa
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"CPA不存在!"
);
}
List
<
BmRegisterDTO
>
registerDtos
=
bmRegisterDao
.
getRegisterInfoListByCpaId
(
cpaId
,
statisMonth
);
if
(
ListUtils
.
isEmpty
(
registerDtos
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"无报名信息!"
);
}
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
try
{
String
title
=
cpa
.
getDetailName
()
+
"-客户信息"
;
List
<
AdvertisingBmOption
>
optionList
=
bmOptionDao
.
getByCPAId
(
cpaId
);
List
<
String
>
rowsNameList
=
new
ArrayList
<>();
rowsNameList
.
add
(
"序号"
);
rowsNameList
.
add
(
"报名人"
);
rowsNameList
.
add
(
"报名时间"
);
for
(
int
t
=
0
;
t
<
optionList
.
size
();
t
++)
{
AdvertisingBmOption
option
=
optionList
.
get
(
t
);
rowsNameList
.
add
(
option
.
getItemTitle
());
}
String
[]
rowsName
=
rowsNameList
.
toArray
(
new
String
[
0
]);
String
filePath
=
exportRegisterInfo
(
title
,
rowsName
,
optionList
,
registerDtos
);
result
.
put
(
"fileName"
,
title
);
result
.
put
(
"filePath"
,
filePath
);
return
result
;
}
catch
(
DataAccessException
e
)
{
LOGGER
.
error
(
"导出用户信息时【exportRegisterInfoByCpaId】"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"导出注册用户相关信息时出现异常"
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"调用commoncenter生成Excel异常:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"导出失败,请稍后重试"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/BmRegisterDao.java
View file @
2a5abfd9
...
@@ -82,4 +82,6 @@ public interface BmRegisterDao extends BaseDao<AdvertisingBmRegister> {
...
@@ -82,4 +82,6 @@ public interface BmRegisterDao extends BaseDao<AdvertisingBmRegister> {
* @return
* @return
*/
*/
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
List
<
BmRegisterDTO
>
getRegisterInfoListByCpaId
(
Long
cpaId
,
String
statisMonth
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/BmRegisterItemDao.java
View file @
2a5abfd9
...
@@ -19,4 +19,6 @@ public interface BmRegisterItemDao extends BaseDao<AdvertisingBmRegisterItem> {
...
@@ -19,4 +19,6 @@ public interface BmRegisterItemDao extends BaseDao<AdvertisingBmRegisterItem> {
* @return
* @return
*/
*/
Integer
checkMobilePhone
(
Long
adId
,
String
fromType
,
Long
fromId
,
String
optionValue
);
Integer
checkMobilePhone
(
Long
adId
,
String
fromType
,
Long
fromId
,
String
optionValue
);
Integer
checkMobilePhone4Cpa
(
Long
cpaId
,
String
fromType
,
Long
fromId
,
String
optionValue
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/BmRegisterDaoImpl.java
View file @
2a5abfd9
...
@@ -89,5 +89,11 @@ public class BmRegisterDaoImpl extends BaseDaoImpl<AdvertisingBmRegister> implem
...
@@ -89,5 +89,11 @@ public class BmRegisterDaoImpl extends BaseDaoImpl<AdvertisingBmRegister> implem
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getRegisterCountByBookId"
),
map
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getRegisterCountByBookId"
),
map
);
}
}
@Override
public
List
<
BmRegisterDTO
>
getRegisterInfoListByCpaId
(
Long
cpaId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"cpaId"
,
cpaId
);
map
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getRegisterInfoListByCpaId"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/BmRegisterItemDaoImpl.java
View file @
2a5abfd9
...
@@ -27,4 +27,14 @@ public class BmRegisterItemDaoImpl extends BaseDaoImpl<AdvertisingBmRegisterItem
...
@@ -27,4 +27,14 @@ public class BmRegisterItemDaoImpl extends BaseDaoImpl<AdvertisingBmRegisterItem
map
.
put
(
"optionValue"
,
optionValue
);
map
.
put
(
"optionValue"
,
optionValue
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"checkMobilePhone"
),
map
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"checkMobilePhone"
),
map
);
}
}
@Override
public
Integer
checkMobilePhone4Cpa
(
Long
cpaId
,
String
fromType
,
Long
fromId
,
String
optionValue
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"cpaId"
,
cpaId
);
map
.
put
(
"fromType"
,
fromType
);
map
.
put
(
"fromId"
,
fromId
);
map
.
put
(
"optionValue"
,
optionValue
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"checkMobilePhone4Cpa"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingBmRegister.java
View file @
2a5abfd9
...
@@ -90,6 +90,19 @@ public class AdvertisingBmRegister extends BaseEntity{
...
@@ -90,6 +90,19 @@ public class AdvertisingBmRegister extends BaseEntity{
*/
*/
private
Long
bookGroupId
;
private
Long
bookGroupId
;
/**
* cpa内容id
*/
private
Long
cpaId
;
public
Long
getCpaId
()
{
return
cpaId
;
}
public
void
setCpaId
(
Long
cpaId
)
{
this
.
cpaId
=
cpaId
;
}
public
Long
getUserId
()
{
public
Long
getUserId
()
{
return
userId
;
return
userId
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingBmRegisterItem.java
View file @
2a5abfd9
...
@@ -46,6 +46,19 @@ public class AdvertisingBmRegisterItem extends BaseEntity{
...
@@ -46,6 +46,19 @@ public class AdvertisingBmRegisterItem extends BaseEntity{
*/
*/
private
List
<
Long
>
optionItemIds
;
private
List
<
Long
>
optionItemIds
;
/**
* cpa内容id
*/
private
Long
cpaId
;
public
Long
getCpaId
()
{
return
cpaId
;
}
public
void
setCpaId
(
Long
cpaId
)
{
this
.
cpaId
=
cpaId
;
}
public
Long
getUserId
()
{
public
Long
getUserId
()
{
return
userId
;
return
userId
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/facade/BmFacade.java
View file @
2a5abfd9
...
@@ -69,7 +69,9 @@ public interface BmFacade {
...
@@ -69,7 +69,9 @@ public interface BmFacade {
@ApiOperation
(
value
=
"微信端获取个人报名详情"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"微信端获取个人报名详情"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"adId"
,
value
=
"广告id"
,
dataType
=
"long"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"adId"
,
value
=
"广告id"
,
dataType
=
"long"
,
paramType
=
"query"
)
@RequestMapping
(
value
=
"/getDetail4Wechat"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getDetail4Wechat"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getDetail4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"adId"
)
Long
adId
)
ResponseDto
<?>
getDetail4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"adId"
,
required
=
false
)
Long
adId
,
@RequestParam
(
value
=
"cpaId"
,
required
=
false
)
Long
cpaId
)
throws
PermissionException
,
BizException
,
JsonParseException
;
throws
PermissionException
,
BizException
,
JsonParseException
;
/**
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/facade/impl/BmFacadeImpl.java
View file @
2a5abfd9
...
@@ -62,11 +62,13 @@ public class BmFacadeImpl implements BmFacade {
...
@@ -62,11 +62,13 @@ public class BmFacadeImpl implements BmFacade {
@RequestMapping
(
value
=
"/userSubmit4Wechat"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/userSubmit4Wechat"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
userSubmit4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
AdvertisingBmRegister
bmRegister
)
public
ResponseDto
<?>
userSubmit4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
AdvertisingBmRegister
bmRegister
)
throws
PermissionException
,
BizException
,
JsonParseException
{
throws
PermissionException
,
BizException
,
JsonParseException
{
if
(
null
==
bmRegister
||
null
==
bmRegister
.
getAdId
(
))
{
if
(
null
==
bmRegister
||
(
null
==
bmRegister
.
getAdId
()
&&
null
==
bmRegister
.
getCpaId
()
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
}
if
(
StringUtil
.
isEmpty
(
bmRegister
.
getFromType
())
||
null
==
bmRegister
.
getFromId
())
{
if
(
null
!=
bmRegister
.
getAdId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
if
(
StringUtil
.
isEmpty
(
bmRegister
.
getFromType
())
||
null
==
bmRegister
.
getFromId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
}
}
Long
qrcodeId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
QRCODE_ID
);
Long
qrcodeId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
QRCODE_ID
);
Long
sceneId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
);
Long
sceneId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
);
...
@@ -75,9 +77,11 @@ public class BmFacadeImpl implements BmFacade {
...
@@ -75,9 +77,11 @@ public class BmFacadeImpl implements BmFacade {
Long
officialAccountsId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_OFFICIAL_ACCOUNTS_ID
);
Long
officialAccountsId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_OFFICIAL_ACCOUNTS_ID
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
bookGroupId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
BOOK_GROUP_ID
);
Long
bookGroupId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
BOOK_GROUP_ID
);
if
((
null
==
bmRegister
.
getBookId
()
&&
!
"WECHAT_GROUP"
.
equals
(
bmRegister
.
getFromType
()))
if
(
null
!=
bmRegister
.
getAdId
())
{
||
(
null
==
bookGroupId
&&
"WECHAT_GROUP"
.
equals
(
bmRegister
.
getFromType
())))
{
if
((
null
==
bmRegister
.
getBookId
()
&&
!
"WECHAT_GROUP"
.
equals
(
bmRegister
.
getFromType
()))
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
||
(
null
==
bookGroupId
&&
"WECHAT_GROUP"
.
equals
(
bmRegister
.
getFromType
())))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
}
}
bmRegister
.
setQrcodeId
(
qrcodeId
);
bmRegister
.
setQrcodeId
(
qrcodeId
);
bmRegister
.
setSceneId
(
sceneId
);
bmRegister
.
setSceneId
(
sceneId
);
...
@@ -86,7 +90,13 @@ public class BmFacadeImpl implements BmFacade {
...
@@ -86,7 +90,13 @@ public class BmFacadeImpl implements BmFacade {
bmRegister
.
setOfficialAccountId
(
officialAccountsId
);
bmRegister
.
setOfficialAccountId
(
officialAccountsId
);
bmRegister
.
setUserId
(
wechatUserId
);
bmRegister
.
setUserId
(
wechatUserId
);
bmRegister
.
setBookGroupId
(
bookGroupId
);
bmRegister
.
setBookGroupId
(
bookGroupId
);
Long
result
=
bmBiz
.
userSubmit
(
bmRegister
,
wechatUserId
);
Long
result
=
null
;
if
(
null
!=
bmRegister
.
getAdId
()){
result
=
bmBiz
.
userSubmit
(
bmRegister
,
wechatUserId
);
}
if
(
null
!=
bmRegister
.
getCpaId
()){
result
=
bmBiz
.
userSubmit4Cpa
(
bmRegister
,
wechatUserId
);
}
return
new
ResponseDto
<>(
result
);
return
new
ResponseDto
<>(
result
);
}
}
...
@@ -95,14 +105,16 @@ public class BmFacadeImpl implements BmFacade {
...
@@ -95,14 +105,16 @@ public class BmFacadeImpl implements BmFacade {
*/
*/
@Override
@Override
@RequestMapping
(
value
=
"/getDetail4Wechat"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getDetail4Wechat"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getDetail4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"adId"
)
Long
adId
)
public
ResponseDto
<?>
getDetail4Wechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"adId"
,
required
=
false
)
Long
adId
,
@RequestParam
(
value
=
"cpaId"
,
required
=
false
)
Long
cpaId
)
throws
PermissionException
,
BizException
,
JsonParseException
{
throws
PermissionException
,
BizException
,
JsonParseException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
qrcodeId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
QRCODE_ID
);
Long
qrcodeId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
QRCODE_ID
);
if
(
null
==
adId
)
{
if
(
(
null
==
adId
&&
null
==
cpaId
)
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
}
return
new
ResponseDto
<>(
bmBiz
.
getDetail4Wechat
(
adId
,
wechatUserId
,
qrcodeId
));
return
new
ResponseDto
<>(
bmBiz
.
getDetail4Wechat
(
adId
,
wechatUserId
,
qrcodeId
,
cpaId
));
}
}
/**
/**
...
@@ -124,4 +136,19 @@ public class BmFacadeImpl implements BmFacade {
...
@@ -124,4 +136,19 @@ public class BmFacadeImpl implements BmFacade {
return
new
ResponseDto
<>(
map
);
return
new
ResponseDto
<>(
map
);
}
}
/**
* cpa内容管理报名信息导出
*/
@RequestMapping
(
value
=
"/exportRegisterInfoByCpaId"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<
Map
<
String
,
Object
>>
exportRegisterInfoByCpaId
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"cpaId"
)
Long
cpaId
,
@RequestParam
(
value
=
"statisMonth"
,
required
=
false
)
String
statisMonth
)
throws
PermissionException
,
BizException
,
JsonParseException
{
if
(
null
==
cpaId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
SessionUtil
.
getInfoToken4Redis
(
token
);
Map
<
String
,
Object
>
map
=
bmBiz
.
exportRegisterInfoByCpaId
(
cpaId
,
statisMonth
);
return
new
ResponseDto
<>(
map
);
}
}
}
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingBmRegisterItemMapper.xml
View file @
2a5abfd9
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<result
column=
"option_item_id"
property=
"optionItemId"
jdbcType=
"BIGINT"
/>
<result
column=
"option_item_id"
property=
"optionItemId"
jdbcType=
"BIGINT"
/>
<result
column=
"option_value"
property=
"optionValue"
jdbcType=
"VARCHAR"
/>
<result
column=
"option_value"
property=
"optionValue"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"cpa_id"
property=
"cpaId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<resultMap
id=
"registerItemDtoMap"
type=
"BmRegisterItemDTO"
>
<resultMap
id=
"registerItemDtoMap"
type=
"BmRegisterItemDTO"
>
...
@@ -27,10 +28,10 @@
...
@@ -27,10 +28,10 @@
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingBmRegisterItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingBmRegisterItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into advertising_bm_register_item (user_id, ad_id,
insert into advertising_bm_register_item (user_id, ad_id,
register_id, option_id, option_item_id,
register_id, option_id, option_item_id,
option_value, create_time)
option_value, create_time
,cpa_id
)
values (#{userId,jdbcType=BIGINT}, #{adId,jdbcType=BIGINT},
values (#{userId,jdbcType=BIGINT}, #{adId,jdbcType=BIGINT},
#{registerId,jdbcType=BIGINT}, #{optionId,jdbcType=BIGINT}, #{optionItemId,jdbcType=BIGINT},
#{registerId,jdbcType=BIGINT}, #{optionId,jdbcType=BIGINT}, #{optionItemId,jdbcType=BIGINT},
#{optionValue,jdbcType=VARCHAR}, NOW())
#{optionValue,jdbcType=VARCHAR}, NOW()
,#{cpaId}
)
</insert>
</insert>
<select
id=
"getRegisterItemByUser"
resultMap=
"registerItemDtoMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getRegisterItemByUser"
resultMap=
"registerItemDtoMap"
parameterType=
"java.lang.Long"
>
...
@@ -66,4 +67,19 @@
...
@@ -66,4 +67,19 @@
AND i.option_value = #{optionValue}
AND i.option_value = #{optionValue}
</select>
</select>
<select
id=
"checkMobilePhone4Cpa"
resultType=
"Integer"
parameterType=
"map"
>
SELECT
COUNT(1)
FROM
advertising_bm_register_item i
LEFT JOIN advertising_bm_register r ON i.register_id = r.id
LEFT JOIN advertising_bm_option o ON i.option_id = o.id
WHERE
i.cpa_id = #{cpaId}
AND r.from_type = #{fromType}
AND r.from_id = #{fromId}
AND o.item_title = '手机号'
AND i.option_value = #{optionValue}
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingBmRegisterMapper.xml
View file @
2a5abfd9
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_day"
property=
"createDay"
jdbcType=
"DATE"
/>
<result
column=
"create_day"
property=
"createDay"
jdbcType=
"DATE"
/>
<result
column=
"create_month"
property=
"createMonth"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_month"
property=
"createMonth"
jdbcType=
"VARCHAR"
/>
<result
column=
"cpa_id"
property=
"cpaId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<!-- 微信端用户详细信息 -->
<!-- 微信端用户详细信息 -->
...
@@ -36,7 +37,7 @@
...
@@ -36,7 +37,7 @@
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, user_id, ad_id, nick_name, create_time, qrcode_id, scene_id, adviser_id, agent_id, channel_id, official_account_id, from_type,
id, user_id, ad_id, nick_name, create_time, qrcode_id, scene_id, adviser_id, agent_id, channel_id, official_account_id, from_type,
from_id,book_id,create_day, create_month
from_id,book_id,create_day, create_month
,cpa_id
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingBmRegister"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingBmRegister"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
@@ -55,7 +56,8 @@
...
@@ -55,7 +56,8 @@
from_id,
from_id,
book_id,
book_id,
create_day,
create_day,
create_month
create_month,
cpa_id
)
)
VALUES
VALUES
(
(
...
@@ -73,7 +75,8 @@
...
@@ -73,7 +75,8 @@
#{fromId,jdbcType=BIGINT},
#{fromId,jdbcType=BIGINT},
#{bookId,jdbcType=BIGINT},
#{bookId,jdbcType=BIGINT},
NOW(),
NOW(),
DATE_FORMAT(NOW(), '%Y-%m')
DATE_FORMAT(NOW(), '%Y-%m'),
#{cpaId}
)
)
</insert>
</insert>
...
@@ -82,8 +85,14 @@
...
@@ -82,8 +85,14 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from advertising_bm_register
from advertising_bm_register
where ad_id = #{adId,jdbcType=BIGINT}
where
and user_id = #{wechatUserId}
user_id = #{wechatUserId}
<if
test=
"adId !=null"
>
and ad_id = #{adId,jdbcType=BIGINT}
</if>
<if
test=
"cpaId !=null"
>
and cpa_id = #{cpaId}
</if>
<if
test=
"qrcodeId != null"
>
<if
test=
"qrcodeId != null"
>
AND qrcode_id = #{qrcodeId}
AND qrcode_id = #{qrcodeId}
</if>
</if>
...
@@ -201,4 +210,16 @@
...
@@ -201,4 +210,16 @@
</if>
</if>
</select>
</select>
<select
id=
"getRegisterInfoListByCpaId"
parameterType=
"map"
resultMap=
"wechatDetailMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM advertising_bm_register
WHERE
cpa_id = #{cpaId}
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
ORDER BY create_time DESC
</select>
</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