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
3d73fa9d
Commit
3d73fa9d
authored
Aug 30, 2019
by
郑永强
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into zhengyongqiang
parents
2ce4cc2b
9d807954
Hide whitespace changes
Inline
Side-by-side
Showing
120 changed files
with
6679 additions
and
138 deletions
+6679
-138
BookDto.java
...-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
+1
-0
BookClockInfoService.java
...a/com/pcloud/book/clock/service/BookClockInfoService.java
+4
-0
BookClassifyDTO.java
.../main/java/com/pcloud/book/group/dto/BookClassifyDTO.java
+54
-0
BookGroupStatisticsDTO.java
...ava/com/pcloud/book/group/dto/BookGroupStatisticsDTO.java
+93
-0
ResourceBrowseParamDto.java
...ava/com/pcloud/book/group/dto/ResourceBrowseParamDto.java
+75
-0
BookGroupClassifyService.java
...m/pcloud/book/group/service/BookGroupClassifyService.java
+12
-4
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+9
-0
WeixinQrcodeService.java
...va/com/pcloud/book/group/service/WeixinQrcodeService.java
+4
-0
BookApplication.java
...e-book/src/main/java/com/pcloud/book/BookApplication.java
+10
-0
BookClockBiz.java
...src/main/java/com/pcloud/book/clock/biz/BookClockBiz.java
+4
-0
BookClockBizImpl.java
...java/com/pcloud/book/clock/biz/impl/BookClockBizImpl.java
+32
-0
BookClockInfoDao.java
...main/java/com/pcloud/book/clock/dao/BookClockInfoDao.java
+2
-0
BookGroupClockDao.java
...ain/java/com/pcloud/book/clock/dao/BookGroupClockDao.java
+4
-0
BookClockInfoDaoImpl.java
.../com/pcloud/book/clock/dao/impl/BookClockInfoDaoImpl.java
+6
-0
BookGroupClockDaoImpl.java
...com/pcloud/book/clock/dao/impl/BookGroupClockDaoImpl.java
+15
-0
BookClockInfoServiceImpl.java
...oud/book/clock/service/impl/BookClockInfoServiceImpl.java
+15
-1
BookConsr.java
...n/java/com/pcloud/book/consumer/settlement/BookConsr.java
+55
-0
SettlementConsr.java
.../com/pcloud/book/consumer/settlement/SettlementConsr.java
+31
-3
TradeConsr.java
.../main/java/com/pcloud/book/consumer/trade/TradeConsr.java
+45
-4
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+13
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+54
-0
BookGroupClassifyBiz.java
.../java/com/pcloud/book/group/biz/BookGroupClassifyBiz.java
+19
-7
GroupQrcodeBiz.java
...c/main/java/com/pcloud/book/group/biz/GroupQrcodeBiz.java
+7
-0
WeixinQrcodeBiz.java
.../main/java/com/pcloud/book/group/biz/WeixinQrcodeBiz.java
+5
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+478
-6
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+49
-14
GroupQrcodeBizImpl.java
...va/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
+48
-9
WeixinQrcodeBizImpl.java
...a/com/pcloud/book/group/biz/impl/WeixinQrcodeBizImpl.java
+33
-4
AppClickRecordDao.java
...ain/java/com/pcloud/book/group/dao/AppClickRecordDao.java
+30
-0
AppTouchRecordDao.java
...ain/java/com/pcloud/book/group/dao/AppTouchRecordDao.java
+2
-0
BookGroupClassifyDao.java
.../java/com/pcloud/book/group/dao/BookGroupClassifyDao.java
+18
-0
BookGroupDao.java
...src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
+5
-0
GroupQrcodeDao.java
...c/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
+6
-0
WeixinQrcodeDao.java
.../main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
+8
-0
AppClickRecordDaoImpl.java
...com/pcloud/book/group/dao/impl/AppClickRecordDaoImpl.java
+44
-0
AppTouchRecordDaoImpl.java
...com/pcloud/book/group/dao/impl/AppTouchRecordDaoImpl.java
+12
-0
BookGroupClassifyDaoImpl.java
.../pcloud/book/group/dao/impl/BookGroupClassifyDaoImpl.java
+30
-0
BookGroupDaoImpl.java
...java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
+7
-0
GroupQrcodeDaoImpl.java
...va/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
+6
-0
WeixinQrcodeDaoImpl.java
...a/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
+10
-0
BookGroupDTO.java
...src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
+18
-0
ClickClassifyDTO.java
...main/java/com/pcloud/book/group/dto/ClickClassifyDTO.java
+58
-0
StatisticsIncomeDto.java
...n/java/com/pcloud/book/group/dto/StatisticsIncomeDto.java
+171
-0
BookGroupClassifyFacade.java
...com/pcloud/book/group/facade/BookGroupClassifyFacade.java
+17
-0
BookGroupFacade.java
...in/java/com/pcloud/book/group/facade/BookGroupFacade.java
+78
-0
GroupQrcodeFacade.java
.../java/com/pcloud/book/group/facade/GroupQrcodeFacade.java
+9
-0
WeixinQrcodeFacade.java
...java/com/pcloud/book/group/facade/WeixinQrcodeFacade.java
+8
-0
BookGroupClassifyFacadeImpl.java
...d/book/group/facade/impl/BookGroupClassifyFacadeImpl.java
+20
-0
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+84
-1
GroupQrcodeFacadeImpl.java
.../pcloud/book/group/facade/impl/GroupQrcodeFacadeImpl.java
+10
-0
WeixinQrcodeFacadeImpl.java
...pcloud/book/group/facade/impl/WeixinQrcodeFacadeImpl.java
+9
-0
BookGroupClassifyServiceImpl.java
...book/group/service/impl/BookGroupClassifyServiceImpl.java
+14
-0
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+15
-1
WeixinQrcodeServiceImpl.java
...loud/book/group/service/impl/WeixinQrcodeServiceImpl.java
+16
-0
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+24
-8
BookGroupClassifyVO.java
...in/java/com/pcloud/book/group/vo/BookGroupClassifyVO.java
+12
-0
ClassifyQrcodeVO.java
.../main/java/com/pcloud/book/group/vo/ClassifyQrcodeVO.java
+23
-1
GroupIncomeStaticParamVO.java
...va/com/pcloud/book/group/vo/GroupIncomeStaticParamVO.java
+88
-0
GroupScanTrendParamVO.java
.../java/com/pcloud/book/group/vo/GroupScanTrendParamVO.java
+106
-0
GroupScanTrendVO.java
.../main/java/com/pcloud/book/group/vo/GroupScanTrendVO.java
+65
-0
GroupStatisticVO.java
.../main/java/com/pcloud/book/group/vo/GroupStatisticVO.java
+139
-0
ListClassifyVO.java
...rc/main/java/com/pcloud/book/group/vo/ListClassifyVO.java
+23
-1
QrStatisticsVO.java
...rc/main/java/com/pcloud/book/group/vo/QrStatisticsVO.java
+6
-32
ResourceClickVO.java
...c/main/java/com/pcloud/book/group/vo/ResourceClickVO.java
+40
-0
ResourcesStatisticVO.java
...n/java/com/pcloud/book/group/vo/ResourcesStatisticVO.java
+100
-0
TotalRescourceDataVO.java
...n/java/com/pcloud/book/group/vo/TotalRescourceDataVO.java
+52
-0
WxGroupStatisticVO.java
...ain/java/com/pcloud/book/group/vo/WxGroupStatisticVO.java
+96
-0
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+36
-14
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+18
-9
ReplyKeywordDTO.java
...in/java/com/pcloud/book/keywords/dto/ReplyKeywordDTO.java
+6
-0
MQTopicConumer.java
...c/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
+5
-0
ReaderCenterBindInfoListener.java
...om/pcloud/book/mq/topic/ReaderCenterBindInfoListener.java
+43
-0
WxGroupSendTextListener.java
...ava/com/pcloud/book/mq/topic/WxGroupSendTextListener.java
+7
-5
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+11
-4
WeixinClockBiz.java
.../java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
+97
-0
WeixinClockBizImpl.java
.../pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
+645
-0
WeixinClockCheck.java
...a/com/pcloud/book/weixinclock/check/WeixinClockCheck.java
+14
-0
WeixinClockCheckImpl.java
...oud/book/weixinclock/check/impl/WeixinClockCheckImpl.java
+41
-0
WeixinClockDao.java
.../java/com/pcloud/book/weixinclock/dao/WeixinClockDao.java
+27
-0
WeixinClockGroupClassifyDao.java
...oud/book/weixinclock/dao/WeixinClockGroupClassifyDao.java
+53
-0
WeixinClockMemberDao.java
...com/pcloud/book/weixinclock/dao/WeixinClockMemberDao.java
+60
-0
WeixinClockPrizeRecordDao.java
...cloud/book/weixinclock/dao/WeixinClockPrizeRecordDao.java
+18
-0
WeixinClockRewardDao.java
...com/pcloud/book/weixinclock/dao/WeixinClockRewardDao.java
+33
-0
WeixinClockTopicDao.java
.../com/pcloud/book/weixinclock/dao/WeixinClockTopicDao.java
+29
-0
WeixinClockDaoImpl.java
.../pcloud/book/weixinclock/dao/impl/WeixinClockDaoImpl.java
+39
-0
WeixinClockGroupClassifyDaoImpl.java
...weixinclock/dao/impl/WeixinClockGroupClassifyDaoImpl.java
+72
-0
WeixinClockMemberDaoImpl.java
...d/book/weixinclock/dao/impl/WeixinClockMemberDaoImpl.java
+95
-0
WeixinClockPrizeRecordDaoImpl.java
...k/weixinclock/dao/impl/WeixinClockPrizeRecordDaoImpl.java
+51
-0
WeixinClockRewardDaoImpl.java
...d/book/weixinclock/dao/impl/WeixinClockRewardDaoImpl.java
+39
-0
WeixinClockTopicDaoImpl.java
...ud/book/weixinclock/dao/impl/WeixinClockTopicDaoImpl.java
+45
-0
ClassifyInfoDto.java
...java/com/pcloud/book/weixinclock/dto/ClassifyInfoDto.java
+57
-0
DrawRewardDto.java
...n/java/com/pcloud/book/weixinclock/dto/DrawRewardDto.java
+81
-0
RankDto.java
...rc/main/java/com/pcloud/book/weixinclock/dto/RankDto.java
+69
-0
WeixinClockDto.java
.../java/com/pcloud/book/weixinclock/dto/WeixinClockDto.java
+213
-0
WeixinClock.java
.../java/com/pcloud/book/weixinclock/entity/WeixinClock.java
+146
-0
WeixinClockGroupClassify.java
...oud/book/weixinclock/entity/WeixinClockGroupClassify.java
+57
-0
WeixinClockMember.java
...com/pcloud/book/weixinclock/entity/WeixinClockMember.java
+147
-0
WeixinClockPrizeRecord.java
...cloud/book/weixinclock/entity/WeixinClockPrizeRecord.java
+114
-0
WeixinClockReward.java
...com/pcloud/book/weixinclock/entity/WeixinClockReward.java
+87
-0
WeixinClockTopic.java
.../com/pcloud/book/weixinclock/entity/WeixinClockTopic.java
+123
-0
WeixinClockFacade.java
...com/pcloud/book/weixinclock/facade/WeixinClockFacade.java
+120
-0
WeixinClockFacadeImpl.java
...d/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
+207
-0
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+5
-2
BookClockInfo.Mapper.xml
.../src/main/resources/mapper/clock/BookClockInfo.Mapper.xml
+6
-0
BookGroupClock.Mapper.xml
...src/main/resources/mapper/clock/BookGroupClock.Mapper.xml
+27
-0
AppClickRecord.xml
...e-book/src/main/resources/mapper/group/AppClickRecord.xml
+90
-0
AppTouchRecord.xml
...e-book/src/main/resources/mapper/group/AppTouchRecord.xml
+5
-0
BookGroupClassify.Mapper.xml
.../main/resources/mapper/group/BookGroupClassify.Mapper.xml
+109
-2
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+9
-0
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+10
-1
WeixinQrcode.Mapper.xml
...k/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
+13
-0
BookKeyword.Mapper.xml
...src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
+3
-1
WeixinClock.Mapper.xml
.../main/resources/mapper/weixinclock/WeixinClock.Mapper.xml
+151
-0
WeixinClockGroupClassify.Mapper.xml
...es/mapper/weixinclock/WeixinClockGroupClassify.Mapper.xml
+101
-0
WeixinClockMember.Mapper.xml
...resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
+98
-0
WeixinClockPrizeRecord.Mapper.xml
...rces/mapper/weixinclock/WeixinClockPrizeRecord.Mapper.xml
+57
-0
WeixinClockReward.Mapper.xml
...resources/mapper/weixinclock/WeixinClockReward.Mapper.xml
+54
-0
WeixinClockTopic.Mapper.xml
.../resources/mapper/weixinclock/WeixinClockTopic.Mapper.xml
+57
-0
template_bookGroupStatistics.ftl
.../main/resources/template/template_bookGroupStatistics.ftl
+321
-0
pom.xml
pom.xml
+2
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
View file @
3d73fa9d
...
...
@@ -553,6 +553,7 @@ public class BookDto extends BaseDto {
*/
private
BigDecimal
outRate
;
public
String
getQrRemark
()
{
return
qrRemark
;
}
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/clock/service/BookClockInfoService.java
View file @
3d73fa9d
...
...
@@ -24,5 +24,9 @@ public interface BookClockInfoService {
@PostMapping
(
"/sendBookClockGroupMessage"
)
void
sendBookClockGroupMessage
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
BizException
;
@ApiOperation
(
value
=
"处理关联应用的打卡的旧数据"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
"/dealOldData4WeixinClock"
,
method
=
RequestMethod
.
GET
)
void
dealOldData4WeixinClock
();
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/BookClassifyDTO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
dto
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
java.io.Serializable
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/25 16:07
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookClassifyDTO
implements
Serializable
{
private
Long
bookId
;
private
Long
bookGroupId
;
private
Long
classifyCount
;
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getClassifyCount
()
{
return
classifyCount
;
}
public
void
setClassifyCount
(
Long
classifyCount
)
{
this
.
classifyCount
=
classifyCount
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
@Override
public
String
toString
()
{
return
"BookClassifyDTO{"
+
"bookId="
+
bookId
+
", bookGroupId="
+
bookGroupId
+
", classifyCount="
+
classifyCount
+
'}'
;
}
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/BookGroupStatisticsDTO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
dto
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
java.io.Serializable
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/25 16:29
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookGroupStatisticsDTO
implements
Serializable
{
/**
* 群分类数
*/
private
Long
classifyCount
;
/**
* 微信群数
*/
private
Long
wxGroupCount
;
/**
* 当前群人数
*/
private
Long
groupPersonNum
;
/**
* 推广应用次数
*/
private
Long
promAppCount
;
/**
* 推广作品次数
*/
private
Long
promProductCount
;
public
Long
getClassifyCount
()
{
return
classifyCount
;
}
public
void
setClassifyCount
(
Long
classifyCount
)
{
this
.
classifyCount
=
classifyCount
;
}
public
Long
getWxGroupCount
()
{
return
wxGroupCount
;
}
public
void
setWxGroupCount
(
Long
wxGroupCount
)
{
this
.
wxGroupCount
=
wxGroupCount
;
}
public
Long
getGroupPersonNum
()
{
return
groupPersonNum
;
}
public
void
setGroupPersonNum
(
Long
groupPersonNum
)
{
this
.
groupPersonNum
=
groupPersonNum
;
}
public
Long
getPromAppCount
()
{
return
promAppCount
;
}
public
void
setPromAppCount
(
Long
promAppCount
)
{
this
.
promAppCount
=
promAppCount
;
}
public
Long
getPromProductCount
()
{
return
promProductCount
;
}
public
void
setPromProductCount
(
Long
promProductCount
)
{
this
.
promProductCount
=
promProductCount
;
}
@Override
public
String
toString
()
{
return
"BookGroupStatisticsDTO{"
+
"classifyCount="
+
classifyCount
+
", wxGroupCount="
+
wxGroupCount
+
", groupPersonNum="
+
groupPersonNum
+
", promAppCount="
+
promAppCount
+
", promProductCount="
+
promProductCount
+
'}'
;
}
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/ResourceBrowseParamDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author 戴兴
* @description TODO
* @date 2019/8/8 20:37
*/
public
class
ResourceBrowseParamDto
implements
Serializable
{
private
Long
bookGroupId
;
private
Long
classifyId
;
private
Long
qrcodeId
;
private
String
typeCode
;
private
List
<
Long
>
Ids
;
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getQrcodeId
()
{
return
qrcodeId
;
}
public
void
setQrcodeId
(
Long
qrcodeId
)
{
this
.
qrcodeId
=
qrcodeId
;
}
public
String
getTypeCode
()
{
return
typeCode
;
}
public
void
setTypeCode
(
String
typeCode
)
{
this
.
typeCode
=
typeCode
;
}
public
List
<
Long
>
getIds
()
{
return
Ids
;
}
public
void
setIds
(
List
<
Long
>
ids
)
{
Ids
=
ids
;
}
@Override
public
String
toString
()
{
return
"ResourceBrowseParamDto{"
+
"bookGroupId="
+
bookGroupId
+
", classifyId="
+
classifyId
+
", qrcodeId="
+
qrcodeId
+
", typeCode='"
+
typeCode
+
'\''
+
", Ids="
+
Ids
+
'}'
;
}
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupClassifyService.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
service
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeBaseDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising
;
import
com.pcloud.book.group.dto.ProAssocGroupAndUserNumberDTO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.common.dto.ResponseDto
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
...
...
@@ -32,6 +29,11 @@ public interface BookGroupClassifyService {
@GetMapping
(
"getClassifyQrcodeInfo"
)
ResponseEntity
<
ResponseDto
<
GroupClassifyQrcodeDTO
>>
getClassifyQrcodeInfo
(
@RequestParam
(
"weixinGroupId"
)
String
weixinGroupId
);
@ApiOperation
(
"根据id获取微信群分类"
)
@PostMapping
(
"getClassifyByIds"
)
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
String
>>>
getClassifyByIds
(
@RequestBody
List
<
Long
>
weixinGroupClassifyPrimaryIds
);
@ApiOperation
(
"根据微信群标识获取相关id"
)
@PostMapping
(
"listGroupQrcodeBaseInfo"
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
GroupQrcodeBaseDTO
>>>
listGroupQrcodeBaseInfo
(
@RequestBody
List
<
String
>
weixinGroupIds
);
...
...
@@ -56,7 +58,13 @@ public interface BookGroupClassifyService {
@PostMapping
(
"filterDeleteId"
)
ResponseEntity
<
ResponseDto
<
List
<
Long
>>>
filterDeleteId
(
@RequestBody
List
<
String
>
wxGroupIdList
);
@ApiOperation
(
"获取用户支付金额"
)
@GetMapping
(
"getPayPrice"
)
ResponseEntity
<
ResponseDto
<
BigDecimal
>>
getPayPrice
(
@RequestParam
(
"qrcodeId"
)
Long
qrcodeId
,
@RequestParam
(
"wxUserId"
)
String
wxUserId
);
@ApiOperation
(
"获取群分类个数"
)
@PostMapping
(
"getGroupClassifyCount"
)
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BookClassifyDTO
>>>
getGroupClassifyCount
(
@RequestBody
List
<
Long
>
bookIds
);
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
3d73fa9d
...
...
@@ -3,9 +3,12 @@ package com.pcloud.book.group.service;
import
java.util.List
;
import
java.util.Map
;
import
com.pcloud.book.group.dto.PersonalQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupCipherDTO
;
import
com.pcloud.book.group.dto.GroupUseDTO
;
import
com.pcloud.book.group.dto.ResourceBrowseParamDto
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -52,6 +55,7 @@ public interface BookGroupService {
@RequestMapping
(
value
=
"getBaseInfoBySceneId"
,
method
=
RequestMethod
.
GET
)
ResponseEntity
<
ResponseDto
<
BookGroupDTO
>>
getBaseInfoBySceneId
(
@RequestParam
(
"sceneId"
)
Long
sceneId
)
throws
BizException
;
@ApiOperation
(
"更新个人二维码"
)
@RequestMapping
(
value
=
"updatePersonQrcode"
,
method
=
RequestMethod
.
POST
)
void
updatePersonQrcode
(
@RequestBody
PersonalQrcodeDTO
personalQrcodeDTO
)
throws
BizException
;
...
...
@@ -72,4 +76,9 @@ public interface BookGroupService {
@GetMapping
(
"/getJoinGroupCipher"
)
ResponseEntity
<
ResponseDto
<
GroupCipherDTO
>>
getJoinGroupCipher
(
@RequestParam
(
"cipher"
)
String
cipher
)
throws
BizException
;
@ApiOperation
(
"获取资源浏览数据"
)
@PostMapping
(
"getResourcesBrowseCount"
)
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
Long
>>>
getResourcesBrowseCount
(
@RequestBody
ResourceBrowseParamDto
resourceBrowseParamDto
);
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/WeixinQrcodeService.java
View file @
3d73fa9d
...
...
@@ -83,6 +83,10 @@ public interface WeixinQrcodeService {
@RequestMapping
(
value
=
"getGroupVersionIp"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
BookWxQrcodeDTO
>>>
getGroupVersionIp
(
@RequestBody
List
<
String
>
wxGroupIds
);
@ApiOperation
(
value
=
"通过群分类id获取微信群id"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
"getWxGroupId"
,
method
=
RequestMethod
.
GET
)
ResponseEntity
<
ResponseDto
<
String
>>
getWxGroupId
(
@RequestParam
(
"classifyId"
)
Long
classifyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/BookApplication.java
View file @
3d73fa9d
...
...
@@ -211,4 +211,14 @@ public class BookApplication {
public
Binding
wxGroupAgreeAddUserBind
()
{
return
RabbitMQFactory
.
bindingExchange
(
wxGroupAgreeAddUserQueue
(),
MQTopicProducer
.
WX_AGREE_ADD_USER
);
}
@Bean
public
Queue
wxGroupUserBindQueue
(){
return
RabbitMQFactory
.
queueBuilder
(
MQTopicConumer
.
CONSUMER_WXGROUP_USER_BIND
);
}
@Bean
public
Binding
wxGroupUserBindBind
(){
return
RabbitMQFactory
.
bindingExchange
(
wxGroupUserBindQueue
(),
MQTopicProducer
.
WXGROUP_USER_BIND
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/biz/BookClockBiz.java
View file @
3d73fa9d
...
...
@@ -67,4 +67,8 @@ public interface BookClockBiz {
*/
void
deleteBookGroupClock
(
Long
bookClockInfoId
,
Long
adviserId
);
/**
* 处理关联应用的打卡的旧数据
*/
void
dealOldData4WeixinClock
();
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/biz/impl/BookClockBizImpl.java
View file @
3d73fa9d
...
...
@@ -28,6 +28,8 @@ import com.pcloud.book.group.dao.WeixinQrcodeDao;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookWxQrcodeDTO
;
import
com.pcloud.book.group.dto.ClassifyDTO
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
...
...
@@ -48,6 +50,8 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -84,6 +88,8 @@ public class BookClockBizImpl implements BookClockBiz {
private
ScheduleService
scheduleService
;
@Autowired
private
WeixinQrcodeDao
weixinQrcodeDao
;
@Autowired
private
WeixinClockBiz
weixinClockBiz
;
/**
...
...
@@ -416,4 +422,30 @@ public class BookClockBizImpl implements BookClockBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"删除定时任务失败!"
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
dealOldData4WeixinClock
()
{
new
Thread
(()
->
{
WeixinClockDto
weixinClockDto
=
new
WeixinClockDto
();
weixinClockDto
.
setClockGuide
(
"每日打卡,养成良好习惯"
);
weixinClockDto
.
setClockIntroduction
(
"欢迎加入打卡,每天一次,养成良好习惯"
);
weixinClockDto
.
setClockKeyword
(
"每日打卡"
);
List
<
BookClockInfoDTO
>
clockInfoIds
=
bookClockInfoDao
.
getAllClockInfoIds
();
if
(!
ListUtils
.
isEmpty
(
clockInfoIds
)){
for
(
BookClockInfoDTO
bookClockInfoDTO:
clockInfoIds
){
List
<
Long
>
list1
=
bookGroupClockDao
.
getClassifyIdsByBookGroupId
(
bookClockInfoDTO
.
getBookClockInfoId
());
List
<
Long
>
list2
=
bookGroupClockDao
.
getClassifyIdsByClassfyId
(
bookClockInfoDTO
.
getBookClockInfoId
());
list1
.
addAll
(
list2
);
List
<
Long
>
resultList
=
list1
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
resultList
))
{
weixinClockDto
.
setCreateUser
(
bookClockInfoDTO
.
getCreateUser
());
weixinClockDto
.
setLastModifiedUser
(
bookClockInfoDTO
.
getCreateUser
());
weixinClockDto
.
setGroupClassifyIds
(
resultList
);
weixinClockBiz
.
createWeixinClock
(
weixinClockDto
);
}
}
}
}).
start
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/dao/BookClockInfoDao.java
View file @
3d73fa9d
...
...
@@ -86,4 +86,6 @@ public interface BookClockInfoDao extends BaseDao<BookClockInfo> {
* @param paramMap
*/
void
deleteBookClockInfo
(
Map
<
String
,
Object
>
paramMap
);
List
<
BookClockInfoDTO
>
getAllClockInfoIds
();
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/dao/BookGroupClockDao.java
View file @
3d73fa9d
...
...
@@ -70,4 +70,8 @@ public interface BookGroupClockDao extends BaseDao<BookGroupClock> {
* @param paramMap
*/
void
deleteBookGroupClock
(
Map
<
String
,
Object
>
paramMap
);
List
<
Long
>
getClassifyIdsByBookGroupId
(
Long
bookClockInfoId
);
List
<
Long
>
getClassifyIdsByClassfyId
(
Long
bookClockInfoId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/dao/impl/BookClockInfoDaoImpl.java
View file @
3d73fa9d
...
...
@@ -135,5 +135,11 @@ public class BookClockInfoDaoImpl extends BaseDaoImpl<BookClockInfo> implements
super
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteBookClockInfo"
),
paramMap
);
}
@Override
public
List
<
BookClockInfoDTO
>
getAllClockInfoIds
()
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getAllClockInfoIds"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/dao/impl/BookGroupClockDaoImpl.java
View file @
3d73fa9d
...
...
@@ -6,6 +6,7 @@ import com.pcloud.book.clock.entity.BookGroupClock;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -100,4 +101,18 @@ public class BookGroupClockDaoImpl extends BaseDaoImpl<BookGroupClock> implement
public
void
deleteBookGroupClock
(
Map
<
String
,
Object
>
paramMap
)
{
super
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteBookGroupClock"
),
paramMap
);
}
@Override
public
List
<
Long
>
getClassifyIdsByBookGroupId
(
Long
bookClockInfoId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookClockInfoId"
,
bookClockInfoId
);
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getClassifyIdsByBookGroupId"
),
paramMap
);
}
@Override
public
List
<
Long
>
getClassifyIdsByClassfyId
(
Long
bookClockInfoId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookClockInfoId"
,
bookClockInfoId
);
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getClassifyIdsByClassfyId"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/clock/service/impl/BookClockInfoServiceImpl.java
View file @
3d73fa9d
...
...
@@ -60,7 +60,21 @@ public class BookClockInfoServiceImpl implements BookClockInfoService {
@RequestMapping
(
value
=
"sendBookClockGroupMessage"
,
method
=
RequestMethod
.
POST
)
public
void
sendBookClockGroupMessage
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
BizException
{
LOGGER
.
info
(
"内部接口群发消息被调用"
+
map
.
toString
());
bookClockBiz
.
sendBookClockGroupMessage
(
map
);
return
;
// bookClockBiz.sendBookClockGroupMessage(map);
}
/**
* @description 处理关联应用的打卡的旧数据
* @author 杨涛
* @date 2019/5/10 10:28
*/
@Override
@RequestMapping
(
value
=
"/dealOldData4WeixinClock"
,
method
=
RequestMethod
.
GET
)
public
void
dealOldData4WeixinClock
()
{
bookClockBiz
.
dealOldData4WeixinClock
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/settlement/BookConsr.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
consumer
.
settlement
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.book.base.exception.BookBizException
;
...
...
@@ -102,4 +109,52 @@ public class BookConsr {
LOGGER
.
info
(
"【书刊-结算(消)】批量获取书刊总收益,<END>"
);
return
resultMap
;
}
@ParamLog
(
value
=
"批量获取社群码下资源的收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
BigDecimal
>
getRescourceIncome
(
GroupRescourceIncomeParamDTO
groupRescourceIncomeParamDTO
)
throws
BizException
{
Map
<
Long
,
BigDecimal
>
rescourceIncome
=
new
HashMap
<>();
try
{
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BigDecimal
>>>
responseEntityP
=
bookService
.
getGroupRescourceIncome
(
groupRescourceIncomeParamDTO
);
rescourceIncome
=
ResponseHandleUtil
.
parseMap
(
responseEntityP
,
Long
.
class
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"批量获取社群码下资源的收益.[getRescourceIncome]:"
+
e
.
getMessage
(),
e
);
}
return
rescourceIncome
;
}
@ParamLog
(
value
=
"批量获取社群码下资源的总收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
BigDecimal
getRescourceTotalIncome
(
GroupRescourceIncomeParamDTO
groupRescourceIncomeParamDTO
)
throws
BizException
{
BigDecimal
rescourceTotalIncome
=
new
BigDecimal
(
0
);
try
{
ResponseEntity
<
ResponseDto
<
BigDecimal
>>
responseEntityP
=
bookService
.
getGroupRescourceTotalIncome
(
groupRescourceIncomeParamDTO
);
rescourceTotalIncome
=
ResponseHandleUtil
.
parseResponse
(
responseEntityP
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"批量获取社群码下资源的总收益.[getRescourceTotalIncome]:"
+
e
.
getMessage
(),
e
);
}
return
rescourceTotalIncome
==
null
?
BigDecimal
.
ZERO
:
rescourceTotalIncome
;
}
@ParamLog
(
value
=
"批量获取社群码分类的收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
BigDecimal
>
getClassifyIncome
(
GetGroupClassifyIncomeDTO
getGroupClassifyIncomeDTO
)
throws
BizException
{
Map
<
Long
,
BigDecimal
>
classifyIncome
=
new
HashMap
<>();
try
{
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BigDecimal
>>>
responseEntityP
=
bookService
.
getGroupClassifyIncome
(
getGroupClassifyIncomeDTO
);
classifyIncome
=
ResponseHandleUtil
.
parseMap
(
responseEntityP
,
Long
.
class
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"批量获取社群码分类的收益.[getClassifyIncome]:"
+
e
.
getMessage
(),
e
);
}
return
classifyIncome
;
}
@ParamLog
(
value
=
"批量获取社群码分类下的微信群收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
BigDecimal
>
getQrcodeIncome
(
GetGroupQrcodeIncomeDTO
getGroupQrcodeIncomeDTO
)
throws
BizException
{
Map
<
Long
,
BigDecimal
>
qrcodeIncome
=
new
HashMap
<>();
try
{
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BigDecimal
>>>
responseEntityP
=
bookService
.
getGroupQrcodeIncome
(
getGroupQrcodeIncomeDTO
);
qrcodeIncome
=
ResponseHandleUtil
.
parseMap
(
responseEntityP
,
Long
.
class
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"批量获取社群码分类下的微信群收益.[getQrcodeIncome]:"
+
e
.
getMessage
(),
e
);
}
return
qrcodeIncome
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/settlement/SettlementConsr.java
View file @
3d73fa9d
...
...
@@ -5,6 +5,9 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.settlementcenter.record.dto.ProductStaticUnderAppMapDTO
;
import
com.pcloud.settlementcenter.record.dto.ResourcesStatisticVO
;
import
com.pcloud.settlementcenter.record.service.BookService
;
import
com.pcloud.settlementcenter.record.service.SettlementService
;
import
org.slf4j.Logger
;
...
...
@@ -14,9 +17,8 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@Component
(
"settlementConsr"
)
public
class
SettlementConsr
{
...
...
@@ -27,6 +29,8 @@ public class SettlementConsr {
@Autowired
private
SettlementService
settlementService
;
@Autowired
private
BookService
bookService
;
@ParamLog
(
value
=
"获取收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
BigDecimal
>
getWXGroupQrcodeIncomeByAdviser
(
List
<
Long
>
groupQrcodeIds
,
Long
adviserId
)
throws
BizException
{
...
...
@@ -55,4 +59,28 @@ public class SettlementConsr {
}
return
map
;
}
@ParamLog
(
value
=
"获取日期列表"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
List
<
Date
>
getDateList
(
Integer
dayNum
,
Date
startDate
,
Date
endDate
)
throws
BizException
{
List
<
Date
>
dateList
=
new
ArrayList
<>();
try
{
ResponseEntity
<
ResponseDto
<
List
<
Date
>>>
responseEntityP
=
settlementService
.
getDateList
(
dayNum
,
startDate
,
endDate
);
dateList
=
ResponseHandleUtil
.
parseList
(
responseEntityP
,
Date
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取日期列表.[getDateList]:"
+
e
.
getMessage
(),
e
);
}
return
dateList
;
}
@ParamLog
(
value
=
"社群码应用下商品的收益"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
List
<
ResourcesStatisticVO
>>
getProductStaticUnderApp
(
ProductStaticUnderAppMapDTO
productStaticUnderAppMapDTO
)
throws
BizException
{
Map
<
Long
,
List
<
ResourcesStatisticVO
>>
resourcesStatisticVOS
=
new
HashMap
<>();
try
{
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
List
<
ResourcesStatisticVO
>>>>
responseEntityP
=
bookService
.
getProductStaticUnderAppMap
(
productStaticUnderAppMapDTO
);
resourcesStatisticVOS
=
ResponseHandleUtil
.
parseMapList
(
responseEntityP
,
Long
.
class
,
ResourcesStatisticVO
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"社群码应用下商品的收益.[getProductStaticUnderApp]:"
+
e
.
getMessage
(),
e
);
}
return
resourcesStatisticVOS
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/trade/TradeConsr.java
View file @
3d73fa9d
...
...
@@ -7,6 +7,7 @@ import com.pcloud.common.utils.ListUtils;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.facade.tradecenter.dto.*
;
import
com.pcloud.facade.tradecenter.service.OrderFormService
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -14,10 +15,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @Author:lili
...
...
@@ -126,6 +124,7 @@ public class TradeConsr {
return
amount
;
}
@ParamLog
(
"获取用户购买或者参与过的社群码ID"
)
public
List
<
Long
>
getBuyBookGroupIdList
(
Long
channelId
,
Long
wechatUserId
)
throws
BizException
{
List
<
Long
>
results
=
new
ArrayList
<>();
...
...
@@ -138,4 +137,46 @@ public class TradeConsr {
return
results
;
}
@ParamLog
(
"获取社群码下的应用作品购买量"
)
public
List
<
ClassifyPayDetailDto
>
getGroupBuyCount
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
Date
startDate
,
Date
endDate
)
throws
BizException
{
List
<
ClassifyPayDetailDto
>
classifyPayDetailDtos
=
new
ArrayList
<>();
try
{
ResponseEntity
<
ResponseDto
<
List
<
ClassifyPayDetailDto
>>>
responseEntity
=
orderFormService
.
getSaleVolume
(
startDate
,
endDate
,
bookGroupId
,
classifyId
,
qrcodeId
);
classifyPayDetailDtos
=
ResponseHandleUtil
.
parseListResponse
(
responseEntity
,
ClassifyPayDetailDto
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取社群码下的应用作品购买量:"
+
e
.
getMessage
(),
e
);
}
if
(
ListUtils
.
isEmpty
(
classifyPayDetailDtos
))
{
classifyPayDetailDtos
=
new
ArrayList
<>();
}
return
classifyPayDetailDtos
;
}
@ParamLog
(
"查询社区码下购买应用详情"
)
public
Map
<
Long
,
GroupMoneyDto
>
getSaleDetail4Group
(
GroupIncomeSearchDto
groupIncomeSearchDto
)
throws
BizException
{
Map
<
Long
,
GroupMoneyDto
>
groupMoneyDtoMap
=
new
HashMap
<>();
try
{
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
GroupMoneyDto
>>>
responseEntity
=
orderFormService
.
getSaleDetail4Group
(
groupIncomeSearchDto
);
groupMoneyDtoMap
=
ResponseHandleUtil
.
parseMap
(
responseEntity
,
Long
.
class
,
GroupMoneyDto
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"查询社区码下购买应用详情:"
+
e
.
getMessage
(),
e
);
}
if
(
MapUtils
.
isEmpty
(
groupMoneyDtoMap
))
{
groupMoneyDtoMap
=
new
HashMap
<>();
}
return
groupMoneyDtoMap
;
}
@ParamLog
(
"查询社群码下购买应用或作品的总销售额"
)
public
BigDecimal
getTotalSale
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
)
throws
BizException
{
BigDecimal
totalSale
=
BigDecimal
.
ZERO
;
try
{
ResponseEntity
<
ResponseDto
<
BigDecimal
>>
responseEntity
=
orderFormService
.
getSaleAmount4Group
(
bookGroupId
,
classifyId
,
qrcodeId
,
type
);
totalSale
=
ResponseHandleUtil
.
parseResponse
(
responseEntity
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"查询社区码下购买应用详情:"
+
e
.
getMessage
(),
e
);
}
return
totalSale
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
3d73fa9d
...
...
@@ -178,6 +178,19 @@ public class WechatGroupConsr {
return
null
;
}
@ParamLog
(
value
=
"群分类累计进群人数与今日进群人数"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
Long
>
getclassifyMemberCount
(
List
<
Long
>
classifyIds
)
throws
BizException
{
if
(
ListUtils
.
isEmpty
(
classifyIds
))
{
return
null
;
}
try
{
return
ResponseHandleUtil
.
parseMapResponse
(
groupMemberService
.
mapGroupClassifyStatisInfo
(
classifyIds
),
Long
.
class
,
Long
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"群分类累计进群人数与今日进群人数.[getclassifyMemberCount]:"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
@ParamLog
(
value
=
"活跃人数与总发言数"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
GroupChatCountDTO
>
getChatCountByGroup
(
List
<
Long
>
groupQrcodeIds
,
Long
bookGroupId
)
throws
BizException
{
if
(
ListUtils
.
isEmpty
(
groupQrcodeIds
))
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
3d73fa9d
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.group.biz;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.dto.AppStatisticsDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.ClassifyKeywordDTO
;
...
...
@@ -9,6 +10,11 @@ import com.pcloud.book.group.dto.GroupStoreMyPayDto;
import
com.pcloud.book.group.dto.QrcodeNameAndProIdDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.common.dto.StoreFlowInfoDto
;
import
com.pcloud.common.exceptions.BizException
;
...
...
@@ -265,6 +271,11 @@ public interface BookGroupBiz {
Boolean
getIsShowBookName
(
Long
partyId
);
/**
* 删除社群码
*/
void
deleteBookGroup
(
Long
bookGroupId
);
/**
* 根据分类id获取个人二维码信息
*/
OwnAltQrcodeInfoDTO
getOwnAltQrcodeInfoDTOByClassifyId
(
Long
wechatUserId
,
Long
classifyId
);
...
...
@@ -317,4 +328,47 @@ public interface BookGroupBiz {
* 获取用户购买或者参与过的社群书信息
*/
PageBeanNew
<
GroupStoreMyPayDto
>
getUserBrowseGroup4KnowLedgeMall
(
Long
channelId
,
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 获取社群码相关数据
*/
BookGroupStatisticsDTO
getBookGroupStatisByBookGroupId
(
Long
bookGroupId
);
/**
* 收益统计
*/
PageBeanNew
<
ResourcesStatisticVO
>
getGroupIncomeStatic
(
GroupIncomeStaticParamVO
groupIncomeStaticParamVO
,
Long
adviserId
);
/**
* 社群码浏览趋势图
*/
List
<
GroupScanTrendVO
>
getGroupScanTrend
(
GroupScanTrendParamVO
groupScanTrendParamVO
,
Long
adviserId
);
/**
* 社群码分类统计
*/
PageBeanNew
<
GroupStatisticVO
>
getClassifyStatistic
(
Long
bookGroupId
,
Long
adviserId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 社群码分类的微信群统计
*/
List
<
WxGroupStatisticVO
>
getQrcodeStatistic
(
Long
bookGroupId
,
Long
classifyId
,
Long
adviserId
);
/**
* 资源数据统计
*/
TotalRescourceDataVO
getTotalRescourceData
(
Long
bookGroupId
,
Long
adviserId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
);
/**
* 资源数据导出
*/
Map
<
String
,
String
>
exportRescourceIncomeData
(
Long
bookGroupId
,
Long
adviserId
);
/**
* 获取资源浏览数据
*/
Map
<
Long
,
Long
>
getResourcesBrowseCount
(
ResourceBrowseParamDto
resourceBrowseParamDto
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupClassifyBiz.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
biz
;
import
com.pcloud.book.group.dto.BookGroupStatisticDTO
;
import
com.pcloud.book.group.dto.ClassifyDTO
;
import
com.pcloud.book.group.dto.ClassifyLearningReportDto
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupNameAndMaxSeqDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeBaseDTO
;
import
com.pcloud.book.group.dto.ProAssocGroupAndUserNumberDTO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.BookGroupClassify
;
import
com.pcloud.book.group.vo.AddClassifyVO
;
import
com.pcloud.book.group.vo.AdviserClassifyParam
;
...
...
@@ -73,6 +67,13 @@ public interface BookGroupClassifyBiz {
ClassifyVO
getClassify
(
Long
classifyId
);
/**
* 根据id获取微信群分类
* @param weixinGroupClassifyPrimaryIds
* @return
*/
Map
<
Long
,
String
>
getClassifyByIds
(
List
<
Long
>
weixinGroupClassifyPrimaryIds
);
/**
* @Author:lili
* @Desr:根据规格对应分类信息
* @Date:2019/4/19 11:46
...
...
@@ -202,6 +203,9 @@ public interface BookGroupClassifyBiz {
PageBeanNew
<
ClassifyDTO
>
listSimpleBookGroupClassify4Adviser
(
Long
adviserId
,
BookGroupClassify
bookGroupClassify
,
PageParam
pageParam
);
PageBeanNew
<
AdviserClassifyVO
>
listAdviserClassify
(
Long
adviserId
,
AdviserClassifyParam
adviserClassifyParam
);
Map
<
Long
,
BookClassifyDTO
>
getGroupClassifyCount
(
List
<
Long
>
bookIds
);
/**
* 更新是否开启微学习报告
*/
...
...
@@ -224,4 +228,12 @@ public interface BookGroupClassifyBiz {
* 拖动排序
*/
void
dragSortClassify
(
List
<
Long
>
classifyIds
);
/**
* 埋点记录点击群分类次数
*/
void
clickClassify
(
Long
wechatUserId
,
Long
bookGroupId
,
Long
classifyId
);
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/GroupQrcodeBiz.java
View file @
3d73fa9d
...
...
@@ -65,6 +65,13 @@ public interface GroupQrcodeBiz {
PageBeanNew
<
ClassifyQrcodeVO
>
listQrcodeByClassify
(
ListQrcodeByClassifyParamVO
listQrcodeByClassifyParamVO
);
/**
* @description 获取社群码类别下的群---不分页
* @author 戴兴
* @date 2019/7/28 15:59
*/
List
<
ClassifyQrcodeVO
>
getQrcodeByClassify
(
Long
bookGroupId
,
Long
classifyId
);
/**
* @Author:lili
* @Desr:修改微信群名称
* @Date:2019/4/1 11:22
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/WeixinQrcodeBiz.java
View file @
3d73fa9d
...
...
@@ -107,6 +107,11 @@ public interface WeixinQrcodeBiz {
QrStatisticsVO
getQrStatistics
();
/**
* 根据版本分类统计平台端二维码数据
*/
List
<
QrStatisticsVO
>
getQrStatisticsByVersion
();
/**
* 分页获取可用微信群
* @param currentPage
* @param numPerPage
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
3d73fa9d
...
...
@@ -17,12 +17,14 @@ import com.pcloud.book.consumer.app.AppConsr;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.raystask.MainLineConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.consumer.settlement.BookConsr
;
import
com.pcloud.book.consumer.settlement.SettlementConsr
;
import
com.pcloud.book.consumer.trade.TradeConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.dao.*
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.BookGroup
;
...
...
@@ -30,12 +32,19 @@ import com.pcloud.book.group.entity.JoinGroupCipher;
import
com.pcloud.book.group.entity.TempletRelevance
;
import
com.pcloud.book.group.enums.LargTempletEnum
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.dao.AppClickRecordDao
;
import
com.pcloud.book.group.dao.AppTouchRecordDao
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.vo.ClassifyAndGroupCountVO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.book.keywords.dao.BookKeywordDao
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
...
...
@@ -57,11 +66,14 @@ import com.pcloud.common.page.PageBean;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.*
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.export.excel.ExcelExportor
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.zip.CompressUtils
;
import
com.pcloud.facade.tradecenter.dto.GroupMoneyDto
;
import
com.pcloud.facade.tradecenter.dto.SpeWechatGroupDto
;
import
com.pcloud.facade.tradecenter.dto.WechatGroupDto
;
import
com.pcloud.facade.tradecenter.dto.*
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.liveapp.live.dto.ProductIdSearchDto
;
import
com.pcloud.liveapp.live.service.TimeTableService
;
...
...
@@ -73,8 +85,14 @@ import com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO;
import
com.pcloud.resourcecenter.product.entity.Product
;
import
com.pcloud.resourcecenter.product.service.ProductService
;
import
com.pcloud.resourcecenter.store.constants.StoreCons
;
import
com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO
;
import
com.pcloud.settlementcenter.record.dto.ProductStaticUnderAppMapDTO
;
import
com.pcloud.settlementcenter.record.service.SettlementService
;
import
com.pcloud.videolesson.schedule.service.ScheduleService
;
import
com.pcloud.wechatgroup.group.dto.GroupMemberStatisDTO
;
import
com.pcloud.wechatgroup.group.service.GroupMemberService
;
import
com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO
;
...
...
@@ -95,10 +113,10 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
static
com
.
sun
.
tools
.
doclets
.
formats
.
html
.
markup
.
HtmlStyle
.
title
;
/**
* Description 社群书群二维码业务逻辑层接口实现类
* Created by PENG on 2019/4/17.
...
...
@@ -170,6 +188,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
private
WechatGroupConsr
wechatGroupConsr
;
@Autowired
private
WeixinQrcodeDao
weixinQrcodeDao
;
@Autowired
private
BookConsr
bookConsr
;
@Autowired
private
GroupQrcodeBiz
groupQrcodeBiz
;
@Override
...
...
@@ -269,9 +292,18 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
null
;
}
List
<
BookGroupDTO
>
list
=
bookGroupDao
.
getDTOByIds
(
bookGroupIds
);
List
<
Long
>
bookIds
=
list
.
stream
().
map
(
BookGroupDTO:
:
getBookId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
BookDto
>
mapByIds
=
bookDao
.
getMapByIds
(
bookIds
);
if
(
ListUtils
.
isEmpty
(
list
))
{
return
null
;
}
list
.
forEach
(
e
->{
if
(!
MapUtils
.
isEmpty
(
mapByIds
)
&&
mapByIds
.
get
(
e
.
getBookId
())
!=
null
){
e
.
setBookName
(
mapByIds
.
get
(
e
.
getBookId
()).
getBookName
());
e
.
setIsbn
(
mapByIds
.
get
(
e
.
getBookId
()).
getIsbn
());
e
.
setBookNumber
(
"BK"
+
e
.
getBookId
());
}
});
return
list
.
stream
().
collect
(
Collectors
.
toMap
(
BookGroupDTO:
:
getId
,
dto
->
dto
));
}
...
...
@@ -1143,6 +1175,30 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
bookGroupDao
.
getIsShowBookName
(
partyId
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"删除社群码"
)
@Override
public
void
deleteBookGroup
(
Long
bookGroupId
)
{
if
(
bookGroupId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空"
);
}
BookGroupDTO
dto
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
dto
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"没有该数据!"
);
}
if
(
dto
.
getBookId
()
!=
null
&&
!
new
Long
(
0L
).
equals
(
dto
.
getBookId
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"该社群码已经绑定图书!"
);
}
ClassifyAndGroupCountVO
classifyAndGroupCount
=
bookGroupClassifyBiz
.
getClassifyAndGroupCount
(
bookGroupId
);
if
(
classifyAndGroupCount
!=
null
&&
((
classifyAndGroupCount
.
getClassifyCount
()
!=
null
&&
classifyAndGroupCount
.
getClassifyCount
()
>
0
)
||
(
classifyAndGroupCount
.
getGroupCount
()
!=
null
&&
classifyAndGroupCount
.
getGroupCount
()
>
0
)))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"该社群码下已有分类!"
);
}
bookGroupDao
.
deleteByBookGroupId
(
bookGroupId
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"根据分类id获取个人二维码信息"
)
@Override
...
...
@@ -1364,7 +1420,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
PageBeanNew
<
ListBook4ChannelVO
>
resultInfos
=
bookDao
.
listPageNew
(
pageParam
,
paramMap
,
"listBookGroup4Channel"
);
List
<
Long
>
bookGroupIds
=
resultInfos
.
getRecordList
().
stream
().
map
(
ListBook4ChannelVO:
:
getBookGroupId
).
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
bookGroupIds
)){
return
new
PageBeanNew
(
0
,
0
,
0
,
new
ArrayList
<>());
return
new
PageBeanNew
(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
Map
<
Long
,
BookGroupStatisticDTO
>
statisMap
=
bookGroupClassifyBiz
.
getBookGroupStatistic
(
bookGroupIds
);
for
(
ListBook4ChannelVO
listBook4ChannelVO
:
resultInfos
.
getRecordList
())
{
...
...
@@ -1422,4 +1478,420 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
resultInfos
.
getTotalCount
(),
results
);
}
@Override
public
BookGroupStatisticsDTO
getBookGroupStatisByBookGroupId
(
Long
bookGroupId
)
{
Map
<
Long
,
BookGroupStatisticDTO
>
bookGroupStatisticMap
=
bookGroupClassifyBiz
.
getBookGroupStatistic
(
Arrays
.
asList
(
bookGroupId
));
BookGroupStatisticsDTO
bookGroupStatisticsDTO
=
new
BookGroupStatisticsDTO
();
Long
appCount
=
appTouchRecordDao
.
getCountByBokkGroupId
(
bookGroupId
,
"APP"
);
Long
productCount
=
appTouchRecordDao
.
getCountByBokkGroupId
(
bookGroupId
,
"PRODUCT"
);
if
(
MapUtils
.
isEmpty
(
bookGroupStatisticMap
)){
bookGroupStatisticsDTO
.
setClassifyCount
(
0L
);
bookGroupStatisticsDTO
.
setGroupPersonNum
(
0L
);
bookGroupStatisticsDTO
.
setWxGroupCount
(
0L
);
bookGroupStatisticsDTO
.
setPromAppCount
(
appCount
);
bookGroupStatisticsDTO
.
setPromProductCount
(
productCount
);
return
bookGroupStatisticsDTO
;
}
bookGroupStatisticsDTO
.
setClassifyCount
(
bookGroupStatisticMap
.
get
(
bookGroupId
).
getClassifyCount
().
longValue
());
bookGroupStatisticsDTO
.
setGroupPersonNum
(
bookGroupStatisticMap
.
get
(
bookGroupId
).
getUserNumber
().
longValue
());
bookGroupStatisticsDTO
.
setWxGroupCount
(
bookGroupStatisticMap
.
get
(
bookGroupId
).
getGroupNumber
().
longValue
());
bookGroupStatisticsDTO
.
setPromAppCount
(
appCount
);
bookGroupStatisticsDTO
.
setPromProductCount
(
productCount
);
return
bookGroupStatisticsDTO
;
}
@Override
public
PageBeanNew
<
ResourcesStatisticVO
>
getGroupIncomeStatic
(
GroupIncomeStaticParamVO
groupIncomeStaticParamVO
,
Long
adviserId
)
{
Long
bookGroupId
=
groupIncomeStaticParamVO
.
getBookGroupId
();
Integer
currentPage
=
groupIncomeStaticParamVO
.
getCurrentPage
();
Integer
numPerPage
=
groupIncomeStaticParamVO
.
getNumPerPage
();
String
type
=
groupIncomeStaticParamVO
.
getType
();
Long
classifyId
=
groupIncomeStaticParamVO
.
getClassifyId
();
Long
wxGroupId
=
groupIncomeStaticParamVO
.
getWxGroupId
();
if
(
currentPage
==
null
||
currentPage
<
0
||
numPerPage
==
null
||
numPerPage
<=
0
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"分页参数错误!"
);
}
if
(
bookGroupId
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"社群码id不能为空!"
);
}
if
(
type
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"类型不能为空"
);
}
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"type"
,
type
);
if
(
null
!=
classifyId
){
map
.
put
(
"classifyId"
,
classifyId
);
}
if
(
null
!=
wxGroupId
){
map
.
put
(
"qrcodeId"
,
wxGroupId
);
}
PageBeanNew
<
ResourcesStatisticVO
>
pageBeanNew
=
appClickRecordDao
.
listPageNew
(
pageParam
,
map
,
"getClickStatistics"
);
List
<
ResourcesStatisticVO
>
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
)){
return
pageBeanNew
;
}
//填充数据
setInfo
(
recordList
,
bookGroupId
,
classifyId
,
wxGroupId
,
type
,
adviserId
);
return
pageBeanNew
;
}
void
setInfo
(
List
<
ResourcesStatisticVO
>
recordList
,
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
,
Long
partyId
){
List
<
Long
>
rescourceIds
=
recordList
.
stream
().
map
(
ResourcesStatisticVO:
:
getRescourceId
).
collect
(
Collectors
.
toList
());
// map.put("rescourceIds",rescourceIds);
GroupRescourceIncomeParamDTO
groupRescourceIncomeParamDTO
=
new
GroupRescourceIncomeParamDTO
();
groupRescourceIncomeParamDTO
.
setBookGroupId
(
bookGroupId
);
groupRescourceIncomeParamDTO
.
setClassifyId
(
classifyId
);
groupRescourceIncomeParamDTO
.
setQrcodeId
(
qrcodeId
);
groupRescourceIncomeParamDTO
.
setType
(
type
);
groupRescourceIncomeParamDTO
.
setRescourceIds
(
rescourceIds
);
groupRescourceIncomeParamDTO
.
setRoleId
(
5L
);
groupRescourceIncomeParamDTO
.
setPartyId
(
partyId
);
Map
<
Long
,
BigDecimal
>
rescourceIncome
=
bookConsr
.
getRescourceIncome
(
groupRescourceIncomeParamDTO
);
GroupIncomeSearchDto
groupIncomeSearchDto
=
new
GroupIncomeSearchDto
();
groupIncomeSearchDto
.
setBookGroupId
(
bookGroupId
);
groupIncomeSearchDto
.
setClassifyId
(
classifyId
);
groupIncomeSearchDto
.
setIds
(
rescourceIds
);
groupIncomeSearchDto
.
setQrcodeId
(
qrcodeId
);
groupIncomeSearchDto
.
setTypeCode
(
type
);
Map
<
Long
,
GroupMoneyDto
>
saleDetail4Group
=
tradeConsr
.
getSaleDetail4Group
(
groupIncomeSearchDto
);
Map
<
Long
,
AppDto
>
appDtoMap
;
Map
<
Long
,
ProductDto
>
productDtoMap
;
if
(
"APP"
.
equals
(
type
)){
appDtoMap
=
appConsr
.
mapByIds
(
rescourceIds
);
recordList
.
forEach
(
e
->{
if
(!
MapUtils
.
isEmpty
(
appDtoMap
)
&&
null
!=
appDtoMap
.
get
(
e
.
getRescourceId
())){
e
.
setRescourceName
(
appDtoMap
.
get
(
e
.
getRescourceId
()).
getTitle
());
}
if
(!
MapUtils
.
isEmpty
(
saleDetail4Group
)
&&
null
!=
saleDetail4Group
.
get
(
e
.
getRescourceId
())){
e
.
setSaleCount
(
saleDetail4Group
.
get
(
e
.
getRescourceId
()).
getSaleCount
());
e
.
setTotalSale
(
new
BigDecimal
(
saleDetail4Group
.
get
(
e
.
getRescourceId
()).
getSaleMoney
()));
}
else
{
e
.
setSaleCount
(
0L
);
e
.
setTotalSale
(
BigDecimal
.
ZERO
);
}
e
.
setType
(
"APP"
);
if
(
null
==
rescourceIncome
.
get
(
e
.
getRescourceId
())){
e
.
setTotalIncome
(
BigDecimal
.
ZERO
);
}
else
{
e
.
setTotalIncome
(
rescourceIncome
.
get
(
e
.
getRescourceId
()));
}
});
}
else
{
productDtoMap
=
productConsr
.
getProBasesByIds
(
rescourceIds
);
recordList
.
forEach
(
e
->{
if
(!
MapUtils
.
isEmpty
(
productDtoMap
)
&&
null
!=
productDtoMap
.
get
(
e
.
getRescourceId
())){
e
.
setRescourceName
(
productDtoMap
.
get
(
e
.
getRescourceId
()).
getProductName
());
}
e
.
setType
(
"PRODUCT"
);
if
(
null
==
rescourceIncome
.
get
(
e
.
getRescourceId
())){
e
.
setTotalIncome
(
BigDecimal
.
ZERO
);
}
else
{
e
.
setTotalIncome
(
rescourceIncome
.
get
(
e
.
getRescourceId
()));
}
if
(!
MapUtils
.
isEmpty
(
saleDetail4Group
)
&&
null
!=
saleDetail4Group
.
get
(
e
.
getRescourceId
())){
e
.
setSaleCount
(
saleDetail4Group
.
get
(
e
.
getRescourceId
()).
getSaleCount
());
e
.
setTotalSale
(
new
BigDecimal
(
saleDetail4Group
.
get
(
e
.
getRescourceId
()).
getSaleMoney
()));
}
else
{
e
.
setSaleCount
(
0L
);
e
.
setTotalSale
(
BigDecimal
.
ZERO
);
}
});
}
}
@Override
public
List
<
GroupScanTrendVO
>
getGroupScanTrend
(
GroupScanTrendParamVO
groupScanTrendParamVO
,
Long
adviserId
)
{
Integer
dayNum
=
groupScanTrendParamVO
.
getDayNum
();
if
(
dayNum
==
null
)
{
groupScanTrendParamVO
.
setDayNum
(
30
);
dayNum
=
30
;
}
Date
startDate
=
groupScanTrendParamVO
.
getStartDate
();
Date
endDate
=
groupScanTrendParamVO
.
getEndDate
();
Long
bookGroupId
=
groupScanTrendParamVO
.
getBookGroupId
();
Long
classifyId
=
groupScanTrendParamVO
.
getClassifyId
();
Long
wxGroupId
=
groupScanTrendParamVO
.
getWxGroupId
();
List
<
Date
>
dateList
=
settlementConsr
.
getDateList
(
dayNum
,
startDate
,
endDate
);
List
<
GroupScanTrendVO
>
groupScanTrendVOS
=
appClickRecordDao
.
getClickTrend
(
groupScanTrendParamVO
);
List
<
Date
>
collect
=
groupScanTrendVOS
.
stream
().
map
(
GroupScanTrendVO:
:
getDate
).
collect
(
Collectors
.
toList
());
List
<
ClassifyPayDetailDto
>
groupBuyCount
=
tradeConsr
.
getGroupBuyCount
(
bookGroupId
,
classifyId
,
wxGroupId
,
startDate
,
endDate
);
List
<
String
>
tradeDate
=
groupBuyCount
.
stream
().
map
(
ClassifyPayDetailDto:
:
getDivideDate
).
collect
(
Collectors
.
toList
());
if
(
dateList
.
size
()
>
groupScanTrendVOS
.
size
())
{
dateList
.
forEach
(
e
->
{
if
(!
collect
.
contains
(
e
))
{
GroupScanTrendVO
groupScanTrendVO
=
new
GroupScanTrendVO
();
groupScanTrendVO
.
setDate
(
e
);
groupScanTrendVO
.
setScanCount
(
0L
);
groupScanTrendVOS
.
add
(
groupScanTrendVO
);
}
});
}
if
(
ListUtils
.
isEmpty
(
groupBuyCount
)){
groupScanTrendVOS
.
forEach
(
e
->
e
.
setBuyCount
(
0L
));
}
else
{
groupScanTrendVOS
.
forEach
(
e
->
{
for
(
ClassifyPayDetailDto
classifyPayDetailDto
:
groupBuyCount
)
{
if
(
DateUtils
.
formatDate
(
e
.
getDate
()).
equals
(
classifyPayDetailDto
.
getDivideDate
()))
{
e
.
setBuyCount
(
classifyPayDetailDto
.
getBuyCount
());
}
else
{
e
.
setBuyCount
(
0L
);
}
}
});
}
return
groupScanTrendVOS
;
}
@Override
public
PageBeanNew
<
GroupStatisticVO
>
getClassifyStatistic
(
Long
bookGroupId
,
Long
adviserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookGroupId"
,
bookGroupId
);
PageBeanNew
<
GroupStatisticVO
>
pageClassify
=
bookGroupClassifyDao
.
listPageNew
(
pageParam
,
paramMap
,
"pageClassify"
);
List
<
GroupStatisticVO
>
recordList
=
pageClassify
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
)){
return
new
PageBeanNew
<>();
}
List
<
Long
>
classifyIds
=
recordList
.
stream
().
map
(
GroupStatisticVO:
:
getClassifyId
).
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
classifyIds
)){
return
new
PageBeanNew
<>();
}
Map
<
Long
,
ClickClassifyDTO
>
longClickClassifyDTOMap
=
bookGroupClassifyDao
.
mapClickClassify
(
classifyIds
);
GetGroupClassifyIncomeDTO
getGroupClassifyIncomeDTO
=
new
GetGroupClassifyIncomeDTO
();
getGroupClassifyIncomeDTO
.
setClassifyIds
(
classifyIds
);
getGroupClassifyIncomeDTO
.
setPartyId
(
adviserId
);
getGroupClassifyIncomeDTO
.
setRoleId
(
5L
);
Map
<
Long
,
BigDecimal
>
classifyIncome
=
bookConsr
.
getClassifyIncome
(
getGroupClassifyIncomeDTO
);
Map
<
Long
,
Long
>
mapMemberCount
=
wechatGroupConsr
.
getclassifyMemberCount
(
classifyIds
);
recordList
.
forEach
(
e
->{
if
(
longClickClassifyDTOMap
.
get
(
e
.
getClassifyId
())
!=
null
){
Long
count
=
longClickClassifyDTOMap
.
get
(
e
.
getClassifyId
()).
getCount
()==
null
?
0L
:
longClickClassifyDTOMap
.
get
(
e
.
getClassifyId
()).
getCount
();
e
.
setClickCount
(
count
);
}
if
(
BigDecimal
.
ZERO
.
compareTo
(
e
.
getPrice
())
==
0
){
e
.
setIsFree
(
1
);
}
else
{
e
.
setIsFree
(
0
);
}
if
(!
MapUtils
.
isEmpty
(
classifyIncome
)){
e
.
setIncome
(
classifyIncome
.
get
(
e
.
getClassifyId
()));
}
else
{
e
.
setIncome
(
BigDecimal
.
ZERO
);
}
if
(!
MapUtils
.
isEmpty
(
mapMemberCount
)){
e
.
setInGroupPersonCount
(
mapMemberCount
.
get
(
e
.
getClassifyId
()));
}
else
{
e
.
setInGroupPersonCount
(
0L
);
}
});
return
pageClassify
;
}
@Override
public
List
<
WxGroupStatisticVO
>
getQrcodeStatistic
(
Long
bookGroupId
,
Long
classifyId
,
Long
adviserId
)
{
List
<
ClassifyQrcodeVO
>
qrcodeByClassify
=
groupQrcodeBiz
.
getQrcodeByClassify
(
bookGroupId
,
classifyId
);
if
(
ListUtils
.
isEmpty
(
qrcodeByClassify
)){
return
new
ArrayList
<>();
}
List
<
Long
>
qrcodeIds
=
qrcodeByClassify
.
stream
().
map
(
ClassifyQrcodeVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
wxGroupIds
=
qrcodeByClassify
.
stream
().
map
(
ClassifyQrcodeVO:
:
getWeixinGroupId
).
collect
(
Collectors
.
toList
());
GetGroupQrcodeIncomeDTO
getGroupQrcodeIncomeDTO
=
new
GetGroupQrcodeIncomeDTO
();
getGroupQrcodeIncomeDTO
.
setRoleId
(
5L
);
getGroupQrcodeIncomeDTO
.
setQrcodeIds
(
qrcodeIds
);
getGroupQrcodeIncomeDTO
.
setPartyId
(
adviserId
);
Map
<
Long
,
BigDecimal
>
qrcodeIncome
=
bookConsr
.
getQrcodeIncome
(
getGroupQrcodeIncomeDTO
);
Map
<
String
,
GroupMemberStatisDTO
>
groupMemberStatisDTOMap
=
wechatGroupConsr
.
listGroupMemberStatisInfo
(
wxGroupIds
);
List
<
WxGroupStatisticVO
>
wxGroupStatisticVOS
=
new
ArrayList
<>();
qrcodeByClassify
.
forEach
(
e
->{
WxGroupStatisticVO
wxGroupStatisticVO
=
new
WxGroupStatisticVO
();
wxGroupStatisticVO
.
setCreatedTime
(
e
.
getCreatedTime
());
wxGroupStatisticVO
.
setGroupPersonCount
(
e
.
getUserNumber
().
longValue
());
if
(
MapUtils
.
isEmpty
(
qrcodeIncome
)){
wxGroupStatisticVO
.
setIncome
(
BigDecimal
.
ZERO
);
}
else
{
wxGroupStatisticVO
.
setIncome
(
qrcodeIncome
.
get
(
e
.
getId
()));
}
if
(
MapUtils
.
isEmpty
(
groupMemberStatisDTOMap
)){
wxGroupStatisticVO
.
setInGroupPersonCount
(
0L
);
}
else
{
wxGroupStatisticVO
.
setInGroupPersonCount
(
groupMemberStatisDTOMap
.
get
(
e
.
getWeixinGroupId
()).
getJoinCount
().
longValue
());
}
wxGroupStatisticVO
.
setQrcodeId
(
e
.
getId
());
wxGroupStatisticVO
.
setWxGroupName
(
e
.
getGroupName
());
wxGroupStatisticVOS
.
add
(
wxGroupStatisticVO
);
});
return
wxGroupStatisticVOS
;
}
@Override
public
TotalRescourceDataVO
getTotalRescourceData
(
Long
bookGroupId
,
Long
adviserId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
)
{
TotalRescourceDataVO
totalRescourceDataVO
=
new
TotalRescourceDataVO
();
List
<
Long
>
rescourceIds
=
appClickRecordDao
.
getRescourceIds
(
bookGroupId
,
classifyId
,
qrcodeId
,
type
);
Long
rescourceTotalClick
=
appClickRecordDao
.
getRescourceTotalClick
(
bookGroupId
,
classifyId
,
qrcodeId
,
type
);
totalRescourceDataVO
.
setClickCount
(
rescourceTotalClick
==
null
?
0L
:
rescourceTotalClick
);
GroupRescourceIncomeParamDTO
groupRescourceIncomeParamDTO
=
new
GroupRescourceIncomeParamDTO
();
groupRescourceIncomeParamDTO
.
setBookGroupId
(
bookGroupId
);
groupRescourceIncomeParamDTO
.
setClassifyId
(
classifyId
);
groupRescourceIncomeParamDTO
.
setQrcodeId
(
qrcodeId
);
groupRescourceIncomeParamDTO
.
setType
(
type
);
groupRescourceIncomeParamDTO
.
setRescourceIds
(
rescourceIds
);
groupRescourceIncomeParamDTO
.
setPartyId
(
adviserId
);
groupRescourceIncomeParamDTO
.
setRoleId
(
5L
);
BigDecimal
rescourceTotalIncome
=
bookConsr
.
getRescourceTotalIncome
(
groupRescourceIncomeParamDTO
);
totalRescourceDataVO
.
setTotalIncome
(
rescourceTotalIncome
==
null
?
BigDecimal
.
ZERO
:
rescourceTotalIncome
);
BigDecimal
totalSale
=
tradeConsr
.
getTotalSale
(
bookGroupId
,
classifyId
,
qrcodeId
,
type
);
totalRescourceDataVO
.
setTotalSale
(
totalSale
);
return
totalRescourceDataVO
;
}
@Override
public
Map
<
String
,
String
>
exportRescourceIncomeData
(
Long
bookGroupId
,
Long
adviserId
)
{
List
<
StatisticsIncomeDto
>
appStatisticsIncomeDtos
=
new
ArrayList
<>();
List
<
StatisticsIncomeDto
>
productStatisticsIncomeDtos
=
new
ArrayList
<>();
List
<
ResourcesStatisticVO
>
appClickStatistics
=
appClickRecordDao
.
getClickStatistics
(
bookGroupId
,
null
,
null
,
"APP"
);
List
<
ResourcesStatisticVO
>
productClickStatistics
=
appClickRecordDao
.
getClickStatistics
(
bookGroupId
,
null
,
null
,
"PRODUCT"
);
if
(!
ListUtils
.
isEmpty
(
appClickStatistics
)){
setInfo
(
appClickStatistics
,
bookGroupId
,
null
,
null
,
"APP"
,
adviserId
);
//获取挂在应用下的商品信息
ProductStaticUnderAppMapDTO
productStaticUnderAppMapDTO
=
new
ProductStaticUnderAppMapDTO
();
productStaticUnderAppMapDTO
.
setBookGroupId
(
bookGroupId
);
productStaticUnderAppMapDTO
.
setAppIds
(
appClickStatistics
.
stream
().
map
(
ResourcesStatisticVO:
:
getRescourceId
).
collect
(
Collectors
.
toList
()));
productStaticUnderAppMapDTO
.
setPartyId
(
adviserId
);
productStaticUnderAppMapDTO
.
setRoleId
(
5L
);
// Map<Long, List<com.pcloud.settlementcenter.record.dto.ResourcesStatisticVO>> productStaticUnderApp = settlementConsr.getProductStaticUnderApp(productStaticUnderAppMapDTO);
// Map<Long, List<StatisticsIncomeDto>> productStaticUnderAppMap = copy(productStaticUnderApp,bookGroupId);
appClickStatistics
.
forEach
(
e
->{
StatisticsIncomeDto
statisticsIncomeDto
=
new
StatisticsIncomeDto
();
statisticsIncomeDto
.
setAppId
(
e
.
getRescourceId
());
statisticsIncomeDto
.
setBookGroupId
(
bookGroupId
);
statisticsIncomeDto
.
setIncome
(
e
.
getTotalIncome
());
statisticsIncomeDto
.
setAppName
(
e
.
getRescourceName
());
statisticsIncomeDto
.
setSaleCounts
(
e
.
getSaleCount
().
intValue
());
statisticsIncomeDto
.
setSaleMoney
(
e
.
getTotalSale
());
statisticsIncomeDto
.
setScanCounts
(
e
.
getBrowseCount
().
intValue
());
// statisticsIncomeDto.setItemList(productStaticUnderAppMap.get(e.getRescourceId()));
appStatisticsIncomeDtos
.
add
(
statisticsIncomeDto
);
});
}
if
(!
ListUtils
.
isEmpty
(
productClickStatistics
)){
setInfo
(
productClickStatistics
,
bookGroupId
,
null
,
null
,
"PRODUCT"
,
adviserId
);
productClickStatistics
.
forEach
(
e
->{
StatisticsIncomeDto
statisticsIncomeDto
=
new
StatisticsIncomeDto
();
statisticsIncomeDto
.
setProductId
(
e
.
getRescourceId
());
statisticsIncomeDto
.
setBookGroupId
(
bookGroupId
);
statisticsIncomeDto
.
setIncome
(
e
.
getTotalIncome
());
statisticsIncomeDto
.
setProductName
(
e
.
getRescourceName
());
statisticsIncomeDto
.
setSaleCounts
(
e
.
getSaleCount
().
intValue
());
statisticsIncomeDto
.
setSaleMoney
(
e
.
getTotalSale
());
statisticsIncomeDto
.
setScanCounts
(
e
.
getBrowseCount
().
intValue
());
productStatisticsIncomeDtos
.
add
(
statisticsIncomeDto
);
});
}
TotalRescourceDataVO
appTotalRescourceData
=
getTotalRescourceData
(
bookGroupId
,
null
,
null
,
null
,
"APP"
);
StatisticsIncomeDto
appSumStatistics
=
setResourceSumStatistics
(
appTotalRescourceData
);
TotalRescourceDataVO
productTotalRescourceData
=
getTotalRescourceData
(
bookGroupId
,
null
,
null
,
null
,
"PRODUCT"
);
StatisticsIncomeDto
productSumStatistics
=
setResourceSumStatistics
(
productTotalRescourceData
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
bookGroupDTO
==
null
){
bookGroupDTO
=
new
BookGroupDTO
();
}
String
groupQrcodeName
=
bookGroupDTO
.
getGroupQrcodeName
()==
null
?
" "
:
bookGroupDTO
.
getGroupQrcodeName
();
String
title
=
"社群码"
+
groupQrcodeName
+
"的收益列表"
;
dataMap
.
put
(
"appIncomeList"
,
appStatisticsIncomeDtos
);
dataMap
.
put
(
"productIncomeList"
,
productStatisticsIncomeDtos
);
dataMap
.
put
(
"title"
,
title
);
dataMap
.
put
(
"appSumStatistics"
,
appSumStatistics
);
dataMap
.
put
(
"productSumStatistics"
,
productSumStatistics
);
String
today
=
DateUtils
.
formatDate
(
DateUtils
.
nowTimeStamp
(),
DateUtils
.
DATE_FORMAT_DATEONLY
);
String
fileName
=
title
+
"-"
+
today
;
String
filePath
=
""
;
try
{
LOGGER
.
info
(
"生成Excel【START】"
);
filePath
=
ExcelExportor
.
uploadExcel
(
this
.
getClass
(),
dataMap
,
"template_bookGroupStatistics.ftl"
);
LOGGER
.
info
(
"生成Excel【END】"
+
filePath
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"生成Excel异常+++"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"导出失败,请联系管理员"
);
}
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"fileName"
,
fileName
);
resultMap
.
put
(
"fileUrl"
,
filePath
);
return
resultMap
;
}
private
StatisticsIncomeDto
setResourceSumStatistics
(
TotalRescourceDataVO
totalRescourceDataVO
){
if
(
totalRescourceDataVO
==
null
){
return
new
StatisticsIncomeDto
();
}
Long
clickCount
=
totalRescourceDataVO
.
getClickCount
();
BigDecimal
totalIncome
=
totalRescourceDataVO
.
getTotalIncome
();
BigDecimal
totalSale
=
totalRescourceDataVO
.
getTotalSale
();
StatisticsIncomeDto
statisticsIncomeDto
=
new
StatisticsIncomeDto
();
statisticsIncomeDto
.
setScanCounts
(
clickCount
.
intValue
());
statisticsIncomeDto
.
setIncome
(
totalIncome
);
statisticsIncomeDto
.
setSaleMoney
(
totalSale
);
return
statisticsIncomeDto
;
}
private
Map
<
Long
,
List
<
StatisticsIncomeDto
>>
copy
(
Map
<
Long
,
List
<
com
.
pcloud
.
settlementcenter
.
record
.
dto
.
ResourcesStatisticVO
>>
productStaticUnderApp
,
Long
bookGroupId
){
Map
<
Long
,
List
<
StatisticsIncomeDto
>>
productStaticUnderAppMap
=
new
HashMap
<>();
if
(
MapUtils
.
isEmpty
(
productStaticUnderApp
)){
return
productStaticUnderAppMap
;
}
List
<
StatisticsIncomeDto
>
productStatisticsIncomeDtos
=
new
ArrayList
<>();
productStaticUnderApp
.
forEach
((
k
,
v
)
->{
v
.
forEach
(
e
->{
StatisticsIncomeDto
statisticsIncomeDto
=
new
StatisticsIncomeDto
();
statisticsIncomeDto
.
setProductId
(
e
.
getRescourceId
());
statisticsIncomeDto
.
setIncome
(
e
.
getTotalIncome
());
statisticsIncomeDto
.
setProductName
(
e
.
getRescourceName
());
statisticsIncomeDto
.
setSaleCounts
(
e
.
getSaleCount
()
==
null
?
0
:
e
.
getSaleCount
().
intValue
());
statisticsIncomeDto
.
setSaleMoney
(
e
.
getTotalSale
());
statisticsIncomeDto
.
setScanCounts
(
e
.
getBrowseCount
()
==
null
?
0
:
e
.
getBrowseCount
().
intValue
());
productStatisticsIncomeDtos
.
add
(
statisticsIncomeDto
);
});
productStaticUnderAppMap
.
put
(
k
,
productStatisticsIncomeDtos
);
});
return
productStaticUnderAppMap
;
}
@Override
public
Map
<
Long
,
Long
>
getResourcesBrowseCount
(
ResourceBrowseParamDto
resourceBrowseParamDto
)
{
Map
<
Long
,
Long
>
resultMap
=
new
HashMap
<>();
Long
bookGroupId
=
resourceBrowseParamDto
.
getBookGroupId
();
Long
classifyId
=
resourceBrowseParamDto
.
getClassifyId
();
Long
qrcodeId
=
resourceBrowseParamDto
.
getQrcodeId
();
String
typeCode
=
resourceBrowseParamDto
.
getTypeCode
();
List
<
Long
>
ids
=
resourceBrowseParamDto
.
getIds
();
if
(
ListUtils
.
isEmpty
(
ids
)){
return
resultMap
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"classifyId"
,
classifyId
);
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"type"
,
typeCode
);
map
.
put
(
"rescourceIds"
,
ids
);
Map
<
Long
,
ResourceClickVO
>
resourceClick
=
appClickRecordDao
.
getResourceClick
(
map
);
if
(
MapUtils
.
isEmpty
(
resourceClick
)){
return
resultMap
;
}
resourceClick
.
forEach
((
k
,
v
)
->{
resultMap
.
put
(
k
,
v
.
getClickCount
());
});
return
resultMap
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
3d73fa9d
...
...
@@ -21,19 +21,7 @@ import com.pcloud.book.group.dao.BookQrcodeUserDao;
import
com.pcloud.book.group.dao.JoinGroupCipherDao
;
import
com.pcloud.book.group.dao.LearningReportBrowseRecordDao
;
import
com.pcloud.book.group.dao.LearningReportTouchRecordDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupStatisticDTO
;
import
com.pcloud.book.group.dto.ClassifyDTO
;
import
com.pcloud.book.group.dto.ClassifyLearningCountDto
;
import
com.pcloud.book.group.dto.ClassifyLearningReportDto
;
import
com.pcloud.book.group.dto.GroupAndUserNumberDTO
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupNameAndMaxSeqDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeBaseDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeInfoDTO
;
import
com.pcloud.book.group.dto.ProAssocGroupAndUserNumberDTO
;
import
com.pcloud.book.group.dto.QrcodeNameAndProIdDTO
;
import
com.pcloud.book.group.dto.WeixinQrcodeDTO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.BookGroupClassify
;
import
com.pcloud.book.group.entity.BookQrcodeUser
;
import
com.pcloud.book.group.entity.GroupQrcode
;
...
...
@@ -98,6 +86,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -192,10 +181,12 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
log
.
info
(
"[新增分类] : 可用微信群数量:{}个"
,
wechatGroupNum
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"群二维码数量不足,您可以明天再创建群。"
);
}
}
Integer
generation
=
null
;
if
(
new
Integer
(
2
).
equals
(
qrcodeNameAndProId
.
getJoinGroupType
()))
{
generation
=
3
;
}
WeixinQrcodeDTO
oneQrcode
=
weixinQrcodeBiz
.
getOneQrcode
(
generation
);
if
(
oneQrcode
==
null
)
{
...
...
@@ -252,7 +243,10 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
bookKeywords
.
add
(
bookKeyword
);
});
bookKeywordDao
.
insert
(
bookKeywords
);
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
oneQrcode
.
getWeixinGroupId
(),
groupQrcode
.
getGroupName
());
final
String
wechatGroupId
=
oneQrcode
.
getWeixinGroupId
();
Map
<
String
,
BookWxQrcodeDTO
>
groupVersion
=
weixinQrcodeBiz
.
getGroupVersion
(
Collections
.
singletonList
(
wechatGroupId
));
String
ip
=
Optional
.
ofNullable
(
groupVersion
.
get
(
wechatGroupId
)).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
();
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
oneQrcode
.
getWeixinGroupId
(),
groupQrcode
.
getGroupName
(),
ip
);
}
@ParamLog
(
"新增商品对应规格"
)
...
...
@@ -406,6 +400,22 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
}
@Override
@ParamLog
(
"根据主键id获取群分类"
)
public
Map
<
Long
,
String
>
getClassifyByIds
(
List
<
Long
>
weixinGroupClassifyPrimaryIds
)
{
if
(
ListUtils
.
isEmpty
(
weixinGroupClassifyPrimaryIds
))
{
return
new
HashMap
<>();
}
List
<
BookGroupClassify
>
bookGroupClassifyList
=
bookGroupClassifyDao
.
getClassifyByIds
(
weixinGroupClassifyPrimaryIds
);
Map
<
Long
,
String
>
classifyMap
=
new
HashMap
<>();
bookGroupClassifyList
.
stream
().
forEach
(
eachBookGroupClassify
->{
Long
key
=
eachBookGroupClassify
.
getId
();
String
value
=
eachBookGroupClassify
.
getClassify
();
classifyMap
.
put
(
key
,
value
);
});
return
classifyMap
;
}
@Override
@ParamLog
(
"根据规格获取分类基本信息(图书,运营,二维码,分类)"
)
public
ClassifyDTO
getBaseInfoBySpecId
(
Long
productSpecId
)
{
ClassifyDTO
classifyDTO
=
bookGroupClassifyDao
.
getBaseInfoBySpecId
(
productSpecId
);
...
...
@@ -952,6 +962,15 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
return
pageBeanNew
;
}
@Override
public
Map
<
Long
,
BookClassifyDTO
>
getGroupClassifyCount
(
List
<
Long
>
bookIds
)
{
if
(!
ListUtils
.
isEmpty
(
bookIds
)){
return
bookGroupClassifyDao
.
getGroupClassifyCount
(
bookIds
);
}
else
{
return
new
HashMap
<>();
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"更新是否开启微学习报告"
)
@Override
...
...
@@ -1049,4 +1068,20 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
bookGroupClassifyDao
.
dragSortClassify
(
classifyIds
);
}
@Override
public
void
clickClassify
(
Long
wechatUserId
,
Long
bookGroupId
,
Long
classifyId
)
{
bookGroupClassifyDao
.
addClickClassify
(
wechatUserId
,
bookGroupId
,
classifyId
);
}
@Override
public
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
)
{
List
<
ListClassifyVO
>
classifyVOS
=
bookGroupClassifyDao
.
getClassifyIngoreDelete
(
bookGroupId
);
if
(
ListUtils
.
isEmpty
(
classifyVOS
)){
return
new
ArrayList
<>();
}
return
classifyVOS
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
View file @
3d73fa9d
...
...
@@ -9,10 +9,24 @@ import com.pcloud.book.consumer.label.LabelConsr;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.*
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.GroupAnnouncementBiz
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
import
com.pcloud.book.group.constants.BookBusinessConstants
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.dto.AutoUpdateGroupNumDTO
;
import
com.pcloud.book.group.dto.BookWxQrcodeDTO
;
import
com.pcloud.book.group.dto.ChangeGroupNameDTO
;
import
com.pcloud.book.group.dto.GroupAndUserNumberDTO
;
import
com.pcloud.book.group.dto.GroupNameAndMaxSeqDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising
;
import
com.pcloud.book.group.dto.GroupQrcodeInfoDTO
;
import
com.pcloud.book.group.dto.PushAddUserMessageDTO
;
import
com.pcloud.book.group.dto.QrcodeNameAndProIdDTO
;
import
com.pcloud.book.group.dto.WeixinQrcodeDTO
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.enums.QrcodeStatusEnum
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
...
...
@@ -28,6 +42,7 @@ import com.pcloud.book.keywords.dto.KeywordUserCountDTO;
import
com.pcloud.book.mq.producer.BookMQProducer
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.riddle.dto.GroupRiddleDTO
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.page.PageBeanNew
;
...
...
@@ -37,7 +52,7 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.pcloud.book.riddle.dto.GroupRiddleDTO
;
import
org.apache.commons.collections4.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -48,7 +63,6 @@ import org.springframework.util.CollectionUtils;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -128,7 +142,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
try
{
if
(
BookBusinessConstants
.
GROUP_NUM_DTO_MAP
.
size
()
<
1
)
{
try
{
Thread
.
sleep
(
5
000
);
Thread
.
sleep
(
10
000
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"[updateGroupNum] InterruptedException:{}"
,
e
);
}
...
...
@@ -146,17 +160,24 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
value
.
getWxGroupId
(),
value
.
getRobotId
(),
value
.
getIp
());
if
(
null
==
peopleCounts
||
peopleCounts
<
1
)
{
log
.
info
(
"[更新群人数] null == peopleCounts || peopleCounts < 1 entry:{}; peopleCounts:{}"
,
entry
,
peopleCounts
);
// 若未获取到将其移除
BookBusinessConstants
.
GROUP_NUM_DTO_MAP
.
remove
(
entry
.
getKey
());
continue
;
}
log
.
info
(
"[更新群人数] entry:{}, peopleCounts:{}"
,
entry
,
peopleCounts
);
groupQrcodeDao
.
updateUserNumber
(
value
.
getWxGroupId
(),
peopleCounts
);
BookBusinessConstants
.
GROUP_NUM_DTO_MAP
.
remove
(
entry
.
getKey
());
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"[updateGroupNum] InterruptedException:{}"
,
e
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"[updateGroupNum] : Exception:{}"
,
e
);
}
try
{
Thread
.
sleep
(
5
000
);
Thread
.
sleep
(
10
000
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"[updateGroupNum] InterruptedException:{}"
,
e
);
}
...
...
@@ -229,6 +250,15 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
return
pageBeanNew
;
}
@Override
public
List
<
ClassifyQrcodeVO
>
getQrcodeByClassify
(
Long
bookGroupId
,
Long
classifyId
)
{
List
<
ClassifyQrcodeVO
>
qrcodeByClassify
=
groupQrcodeDao
.
getQrcodeByClassify
(
classifyId
);
if
(
ListUtils
.
isEmpty
(
qrcodeByClassify
)){
return
new
ArrayList
<>();
}
return
qrcodeByClassify
;
}
@ParamLog
(
value
=
"设置关键词次数"
,
isBefore
=
false
)
private
void
setKeywordCount
(
List
<
ClassifyQrcodeVO
>
classifyQrcodeVOS
)
{
if
(
ListUtils
.
isEmpty
(
classifyQrcodeVOS
))
{
...
...
@@ -279,8 +309,11 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
groupQrcodeDao
.
modifyNameById
(
wechatGroupName
,
id
,
updateUser
);
if
(
changeGroupNameDTO
!=
null
)
{
//获取修改群名称小号
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
changeGroupNameDTO
.
getWxGroupId
());
SendWeixinRequestTools
.
changeGroupName
(
robotId
,
changeGroupNameDTO
.
getWxGroupId
(),
wechatGroupName
);
final
String
wechatGroupId
=
changeGroupNameDTO
.
getWxGroupId
();
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
wechatGroupId
);
Map
<
String
,
BookWxQrcodeDTO
>
groupVersion
=
weixinQrcodeBiz
.
getGroupVersion
(
Collections
.
singletonList
(
wechatGroupId
));
String
ip
=
Optional
.
ofNullable
(
groupVersion
.
get
(
wechatGroupId
)).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
();
SendWeixinRequestTools
.
changeGroupName
(
robotId
,
changeGroupNameDTO
.
getWxGroupId
(),
wechatGroupName
,
ip
);
}
}
...
...
@@ -311,6 +344,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
numDTO
=
new
AutoUpdateGroupNumDTO
(
weixinGroupId
,
robotId
,
ip
,
new
Date
());
}
else
{
numDTO
.
getNum
().
incrementAndGet
();
numDTO
.
setRobotId
(
robotId
);
numDTO
.
setIp
(
ip
);
numDTO
.
setWxGroupId
(
weixinGroupId
);
numDTO
.
setStartTime
(
new
Date
());
}
BookBusinessConstants
.
GROUP_NUM_DTO_MAP
.
put
(
weixinGroupId
,
numDTO
);
...
...
@@ -526,7 +562,10 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
}
});
//String robotId = wechatGroupConsr.getRobotIdByGroupId(oneQrcode.getWeixinGroupId());
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
oneQrcode
.
getWeixinGroupId
(),
groupName
);
final
String
wechatGroupId
=
oneQrcode
.
getWeixinGroupId
();
Map
<
String
,
BookWxQrcodeDTO
>
groupVersion
=
weixinQrcodeBiz
.
getGroupVersion
(
Collections
.
singletonList
(
wechatGroupId
));
String
ip
=
Optional
.
ofNullable
(
groupVersion
.
get
(
wechatGroupId
)).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
();
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
wechatGroupId
,
groupName
,
ip
);
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/WeixinQrcodeBizImpl.java
View file @
3d73fa9d
...
...
@@ -30,7 +30,6 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.sdk.wxgroup.AddToGroupVO
;
import
com.sdk.wxgroup.GroupInfoVO
;
import
com.sdk.wxgroup.QrcodeVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
...
...
@@ -49,8 +48,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -220,7 +217,10 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
}
for
(
ChangeGroupNameDTO
changeGroupNameDTO
:
changeGroupNameDTOS
)
{
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
changeGroupNameDTO
.
getWxGroupId
());
SendWeixinRequestTools
.
changeGroupName
(
robotId
,
changeGroupNameDTO
.
getWxGroupId
(),
changeGroupNameDTO
.
getWxGroupName
());
final
String
wechatGroupId
=
changeGroupNameDTO
.
getWxGroupId
();
Map
<
String
,
BookWxQrcodeDTO
>
groupVersion
=
weixinQrcodeBiz
.
getGroupVersion
(
Collections
.
singletonList
(
wechatGroupId
));
String
ip
=
Optional
.
ofNullable
(
groupVersion
.
get
(
wechatGroupId
)).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
();
SendWeixinRequestTools
.
changeGroupName
(
robotId
,
changeGroupNameDTO
.
getWxGroupId
(),
changeGroupNameDTO
.
getWxGroupName
(),
ip
);
}
}
...
...
@@ -324,6 +324,35 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
}
@Override
@ParamLog
(
"按照版本分类获取平台端统计数据"
)
public
List
<
QrStatisticsVO
>
getQrStatisticsByVersion
()
{
List
<
QrStatisticsVO
>
qrStatistics
=
weixinQrcodeDao
.
getQrStatisticsByVersion
();
List
<
QrStatisticsVO
>
counts
=
weixinQrcodeDao
.
getQrcodeCountByVersion
();
if
(
ListUtils
.
isEmpty
(
qrStatistics
))
{
qrStatistics
=
new
ArrayList
<>();
QrStatisticsVO
qr
=
new
QrStatisticsVO
();
qr
.
setAllCount
(
0
);
qr
.
setInUseCount
(
0
);
qr
.
setNotUseCount
(
0
);
qr
.
setVersion
(
0
);
qrStatistics
.
add
(
qr
);
return
qrStatistics
;
}
// 组合两部分数据
for
(
QrStatisticsVO
qr:
qrStatistics
){
for
(
QrStatisticsVO
c:
counts
){
if
(
qr
.
getVersion
().
equals
(
c
.
getVersion
())){
qr
.
setAllCount
(
c
.
getAllCount
());
break
;
}
}
}
return
qrStatistics
;
}
@Override
@ParamLog
(
"分页获取可用微信群"
)
public
List
<
BookWxQrcodeDTO
>
listAvailableGroupByPage
(
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/AppClickRecordDao.java
View file @
3d73fa9d
...
...
@@ -3,9 +3,14 @@ package com.pcloud.book.group.dao;
import
com.pcloud.book.group.dto.AppClickDTO
;
import
com.pcloud.book.group.dto.AppStatisticsDTO
;
import
com.pcloud.book.group.entity.AppClickRecord
;
import
com.pcloud.book.group.vo.GroupScanTrendParamVO
;
import
com.pcloud.book.group.vo.GroupScanTrendVO
;
import
com.pcloud.book.group.vo.ResourceClickVO
;
import
com.pcloud.book.group.vo.ResourcesStatisticVO
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
import
java.util.Map
;
public
interface
AppClickRecordDao
extends
BaseDao
<
AppClickRecord
>
{
/**
...
...
@@ -17,4 +22,29 @@ public interface AppClickRecordDao extends BaseDao<AppClickRecord> {
* 获取最近点击
*/
List
<
AppClickDTO
>
getRecentlyClick
(
Long
wechatUserId
,
Long
qrcodeId
,
Integer
top
);
/**
* 获取资源点击趋势
*/
List
<
GroupScanTrendVO
>
getClickTrend
(
GroupScanTrendParamVO
groupScanTrendParamVO
);
/**
* 获取资源点击次数
*/
Map
<
Long
,
ResourceClickVO
>
getResourceClick
(
Map
<
String
,
Object
>
map
);
/**
* 获取资源点击总数
*/
Long
getRescourceTotalClick
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
);
/**
* 获取资源id
*/
List
<
Long
>
getRescourceIds
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
);
/**
* 获取资源点击数
*/
List
<
ResourcesStatisticVO
>
getClickStatistics
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/AppTouchRecordDao.java
View file @
3d73fa9d
...
...
@@ -4,4 +4,6 @@ import com.pcloud.book.group.entity.AppTouchRecord;
import
com.pcloud.common.core.dao.BaseDao
;
public
interface
AppTouchRecordDao
extends
BaseDao
<
AppTouchRecord
>
{
Long
getCountByBokkGroupId
(
Long
bookGroupId
,
String
type
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupClassifyDao.java
View file @
3d73fa9d
...
...
@@ -62,6 +62,14 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
Integer
getClassifyCount
(
Long
bookGroupId
);
/**
* 据id获取微信分类
* @param weixinGroupClassifyPrimaryIds
* @return
*/
List
<
BookGroupClassify
>
getClassifyByIds
(
List
<
Long
>
weixinGroupClassifyPrimaryIds
);
/**
* @Author:lili
* @Desr:获取所有分类列表
* @Date:2019/4/18 19:46
...
...
@@ -233,6 +241,8 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
* @return
*/
List
<
ClassifyKeywordDTO
>
getClassifyStatistics
(
Long
bookId
);
Map
<
Long
,
BookClassifyDTO
>
getGroupClassifyCount
(
List
<
Long
>
bookIds
);
GroupClassifyQrcodeDTO
getClassifyQrcodeInfoByName
(
String
weixinGroupName
);
...
...
@@ -241,8 +251,16 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
*/
void
updateHasOpenLearningReport
(
Long
classifyId
,
Boolean
hasOpenLearningReport
,
Long
partyId
);
/**
* 拖动排序
*/
void
dragSortClassify
(
List
<
Long
>
classifyIds
);
void
addClickClassify
(
Long
wechatUserId
,
Long
bookGroupId
,
Long
classifyId
);
Map
<
Long
,
ClickClassifyDTO
>
mapClickClassify
(
List
<
Long
>
classifyIds
);
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
View file @
3d73fa9d
...
...
@@ -143,4 +143,9 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* 获取是否显示书名
*/
Boolean
getIsShowBookName
(
Long
partyId
);
/**
* 删除社群书
*/
void
deleteByBookGroupId
(
Long
bookGroupId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
View file @
3d73fa9d
...
...
@@ -3,6 +3,7 @@ package com.pcloud.book.group.dao;
import
com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.vo.ClassifyQrcodeVO
;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.group.vo.ListGroupQrcodeResponseVO
;
import
com.pcloud.common.core.dao.BaseDao
;
...
...
@@ -204,4 +205,9 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
*/
void
updateRiddleOpenStatus
(
Long
qrcodeId
,
Boolean
status
);
/**
* 根据分类id获取分类下的群---不分页
*/
List
<
ClassifyQrcodeVO
>
getQrcodeByClassify
(
Long
classifyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
View file @
3d73fa9d
...
...
@@ -41,6 +41,12 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
QrStatisticsVO
getQrStatistics
();
/**
* 获取依据版本分类的二维码统计数据
* @return 依据版本分类的二维码统计数据
*/
List
<
QrStatisticsVO
>
getQrStatisticsByVersion
();
/**
* @Author:lili
* @Desr:将处理中的二维码修改为处理失败
* @Date:2019/3/7 15:21
...
...
@@ -117,6 +123,8 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
*/
Integer
getQrcodeCount
();
List
<
QrStatisticsVO
>
getQrcodeCountByVersion
();
/**
* @Author:lili
* @Desr:校验存在性
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/AppClickRecordDaoImpl.java
View file @
3d73fa9d
...
...
@@ -4,6 +4,10 @@ import com.pcloud.book.group.dao.AppClickRecordDao;
import
com.pcloud.book.group.dto.AppClickDTO
;
import
com.pcloud.book.group.dto.AppStatisticsDTO
;
import
com.pcloud.book.group.entity.AppClickRecord
;
import
com.pcloud.book.group.vo.GroupScanTrendParamVO
;
import
com.pcloud.book.group.vo.GroupScanTrendVO
;
import
com.pcloud.book.group.vo.ResourceClickVO
;
import
com.pcloud.book.group.vo.ResourcesStatisticVO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -35,4 +39,44 @@ public class AppClickRecordDaoImpl extends BaseDaoImpl<AppClickRecord> implement
map
.
put
(
"top"
,
top
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getRecentlyClick"
),
map
);
}
@Override
public
List
<
GroupScanTrendVO
>
getClickTrend
(
GroupScanTrendParamVO
groupScanTrendParamVO
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getClickTrend"
),
groupScanTrendParamVO
);
}
@Override
public
Map
<
Long
,
ResourceClickVO
>
getResourceClick
(
Map
<
String
,
Object
>
map
)
{
return
this
.
getSqlSession
().
selectMap
(
this
.
getStatement
(
"getResourceClick"
),
map
,
"rescourceId"
);
}
@Override
public
Long
getRescourceTotalClick
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"classifyId"
,
classifyId
);
map
.
put
(
"type"
,
type
);
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getRescourceTotalClick"
),
map
);
}
@Override
public
List
<
Long
>
getRescourceIds
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"classifyId"
,
classifyId
);
map
.
put
(
"type"
,
type
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getRescourceIds"
),
map
);
}
@Override
public
List
<
ResourcesStatisticVO
>
getClickStatistics
(
Long
bookGroupId
,
Long
classifyId
,
Long
qrcodeId
,
String
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"classifyId"
,
classifyId
);
map
.
put
(
"type"
,
type
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getClickStatistics"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/AppTouchRecordDaoImpl.java
View file @
3d73fa9d
...
...
@@ -5,6 +5,9 @@ import com.pcloud.book.group.entity.AppTouchRecord;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @Description
* @Author ruansiyuan
...
...
@@ -12,4 +15,13 @@ import org.springframework.stereotype.Component;
**/
@Component
(
"appTouchRecordDao"
)
public
class
AppTouchRecordDaoImpl
extends
BaseDaoImpl
<
AppTouchRecord
>
implements
AppTouchRecordDao
{
@Override
public
Long
getCountByBokkGroupId
(
Long
bookGroupId
,
String
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"type"
,
type
);
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getCountByBokkGroupId"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupClassifyDaoImpl.java
View file @
3d73fa9d
...
...
@@ -65,6 +65,10 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
}
@Override
public
List
<
BookGroupClassify
>
getClassifyByIds
(
List
<
Long
>
weixinGroupClassifyPrimaryIds
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getClassifyByIds"
),
weixinGroupClassifyPrimaryIds
);
}
@Override
public
List
<
ListClassifyVO
>
listAllClassifyByRank
(
Long
bookGroupId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"listAllClassifyByRank"
),
bookGroupId
);
}
...
...
@@ -197,6 +201,11 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
public
List
<
ClassifyKeywordDTO
>
getClassifyStatistics
(
Long
bookId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getClassifyStatistics"
),
bookId
);
}
@Override
public
Map
<
Long
,
BookClassifyDTO
>
getGroupClassifyCount
(
List
<
Long
>
bookIds
)
{
return
this
.
getSessionTemplate
().
selectMap
(
getStatement
(
"getGroupClassifyCount"
),
bookIds
,
"bookId"
);
}
@Override
public
GroupClassifyQrcodeDTO
getClassifyQrcodeInfoByName
(
String
weixinGroupName
)
{
...
...
@@ -218,4 +227,25 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
paramMap
.
put
(
"classifyIds"
,
classifyIds
);
this
.
getSqlSession
().
update
(
this
.
getStatement
(
"dragSortClassify"
),
paramMap
);
}
@Override
public
void
addClickClassify
(
Long
wechatUserId
,
Long
bookGroupId
,
Long
classifyId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"classifyId"
,
classifyId
);
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
paramMap
.
put
(
"bookGroupId"
,
bookGroupId
);
this
.
getSqlSession
().
insert
(
this
.
getStatement
(
"addClickClassify"
),
paramMap
);
}
@Override
public
Map
<
Long
,
ClickClassifyDTO
>
mapClickClassify
(
List
<
Long
>
classifyIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"classifyIds"
,
classifyIds
);
return
this
.
getSqlSession
().
selectMap
(
this
.
getStatement
(
"mapClickClassify"
),
paramMap
,
"classifyId"
);
}
@Override
public
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getClassifyIngoreDelete"
),
bookGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
View file @
3d73fa9d
...
...
@@ -150,4 +150,11 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
public
Boolean
getIsShowBookName
(
Long
partyId
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getIsShowBookName"
),
partyId
);
}
@Override
public
void
deleteByBookGroupId
(
Long
bookGroupId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookGroupId"
,
bookGroupId
);
super
.
getSqlSession
().
update
(
getStatement
(
"deleteByBookGroupId"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
View file @
3d73fa9d
...
...
@@ -6,6 +6,7 @@ import com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.vo.ClassifyQrcodeVO
;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.group.vo.ListGroupQrcodeResponseVO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
...
...
@@ -197,4 +198,9 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
getSessionTemplate
().
update
(
getStatement
(
"updateRiddleOpenStatus"
),
map
);
}
public
List
<
ClassifyQrcodeVO
>
getQrcodeByClassify
(
Long
classifyId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getQrcodeByClassify"
),
classifyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
View file @
3d73fa9d
...
...
@@ -47,6 +47,11 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
}
@Override
public
List
<
QrStatisticsVO
>
getQrStatisticsByVersion
()
{
return
this
.
getSessionTemplate
().
selectList
(
this
.
getStatement
(
"getQrStatisticsByVersion"
));
}
@Override
public
void
updateStatusToError
()
{
this
.
getSqlSession
().
update
(
this
.
getStatement
(
"updateStatusToError"
));
}
...
...
@@ -118,6 +123,11 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
}
@Override
public
List
<
QrStatisticsVO
>
getQrcodeCountByVersion
()
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getQrcodeCountByVersion"
));
}
@Override
public
Boolean
checkExist
(
String
weixinGroupId
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"checkExist"
),
weixinGroupId
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
View file @
3d73fa9d
...
...
@@ -133,6 +133,11 @@ public class BookGroupDTO extends BaseDto {
private
String
bookName
;
/**
* 编号
*/
private
String
bookNumber
;
private
String
url
;
private
Long
bookClockInfoId
;
...
...
@@ -364,6 +369,7 @@ public class BookGroupDTO extends BaseDto {
this
.
isShowBookName
=
isShowBookName
;
}
public
Integer
getJoinGroupType
()
{
return
joinGroupType
;
}
...
...
@@ -372,6 +378,14 @@ public class BookGroupDTO extends BaseDto {
this
.
joinGroupType
=
joinGroupType
;
}
public
String
getBookNumber
()
{
return
bookNumber
;
}
public
void
setBookNumber
(
String
bookNumber
)
{
this
.
bookNumber
=
bookNumber
;
}
@Override
public
String
toString
()
{
return
"BookGroupDTO{"
+
...
...
@@ -399,10 +413,13 @@ public class BookGroupDTO extends BaseDto {
", bookImg='"
+
bookImg
+
'\''
+
", isbn='"
+
isbn
+
'\''
+
", bookName='"
+
bookName
+
'\''
+
", bookNumber='"
+
bookNumber
+
'\''
+
", url='"
+
url
+
'\''
+
", bookClockInfoId="
+
bookClockInfoId
+
", isShowBookName="
+
isShowBookName
+
", joinGroupType="
+
joinGroupType
+
"} "
+
super
.
toString
();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/ClickClassifyDTO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
dto
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @author 戴兴
* @description TODO
* @date 2019/8/22 21:49
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
ClickClassifyDTO
implements
Serializable
{
@ApiModelProperty
(
"社群码标识"
)
private
Long
bookGroupId
;
@ApiModelProperty
(
"分类标识"
)
private
Long
classifyId
;
@ApiModelProperty
(
"点击次数"
)
private
Long
count
;
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getCount
()
{
return
count
;
}
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
@Override
public
String
toString
()
{
return
"ClickClassifyDTO{"
+
"bookGroupId="
+
bookGroupId
+
", classifyId="
+
classifyId
+
", count="
+
count
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/StatisticsIncomeDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
dto
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author 戴兴
* @description TODO
* @date 2019/8/8 21:39
*/
public
class
StatisticsIncomeDto
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
4695716936925368521L
;
/**
* 应用标识
*/
private
Long
appId
;
/**
* 书刊标识
*/
private
Long
bookGroupId
;
/**
* 应用名称
*/
private
String
appName
;
/**
* 浏览量
*/
private
Integer
scanCounts
;
/**
* 销售量
*/
private
Integer
saleCounts
;
/**
* 销售额
*/
private
BigDecimal
saleMoney
;
/**
* 收益额
*/
private
BigDecimal
income
;
/**
* 商品标识
*/
private
Long
productId
;
/**
* 商品名称
*/
private
String
productName
;
/**
* 收益时间
*/
private
String
dateTime
;
/**
* 子项
*/
private
List
<
StatisticsIncomeDto
>
itemList
;
public
Long
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Long
appId
)
{
this
.
appId
=
appId
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getAppName
()
{
return
appName
;
}
public
void
setAppName
(
String
appName
)
{
this
.
appName
=
appName
;
}
public
Integer
getScanCounts
()
{
return
scanCounts
;
}
public
void
setScanCounts
(
Integer
scanCounts
)
{
this
.
scanCounts
=
scanCounts
;
}
public
Integer
getSaleCounts
()
{
return
saleCounts
;
}
public
void
setSaleCounts
(
Integer
saleCounts
)
{
this
.
saleCounts
=
saleCounts
;
}
public
BigDecimal
getSaleMoney
()
{
return
saleMoney
;
}
public
void
setSaleMoney
(
BigDecimal
saleMoney
)
{
this
.
saleMoney
=
saleMoney
;
}
public
BigDecimal
getIncome
()
{
return
income
;
}
public
void
setIncome
(
BigDecimal
income
)
{
this
.
income
=
income
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
public
String
getDateTime
()
{
return
dateTime
;
}
public
void
setDateTime
(
String
dateTime
)
{
this
.
dateTime
=
dateTime
;
}
public
List
<
StatisticsIncomeDto
>
getItemList
()
{
return
itemList
;
}
public
void
setItemList
(
List
<
StatisticsIncomeDto
>
itemList
)
{
this
.
itemList
=
itemList
;
}
@Override
public
String
toString
()
{
return
"StatisticsIncomeDto{"
+
"appId="
+
appId
+
", bookGroupId="
+
bookGroupId
+
", appName='"
+
appName
+
'\''
+
", scanCounts="
+
scanCounts
+
", saleCounts="
+
saleCounts
+
", saleMoney="
+
saleMoney
+
", income="
+
income
+
", productId="
+
productId
+
", productName='"
+
productName
+
'\''
+
", dateTime='"
+
dateTime
+
'\''
+
", itemList="
+
itemList
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupClassifyFacade.java
View file @
3d73fa9d
...
...
@@ -172,6 +172,7 @@ public interface BookGroupClassifyFacade {
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
@ApiParam
(
"关键词"
)
String
keyword
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"拖动排序"
)
@PostMapping
(
"dragSortClassify"
)
ResponseDto
<?>
dragSortClassify
(
...
...
@@ -179,4 +180,20 @@ public interface BookGroupClassifyFacade {
@RequestBody
List
<
Long
>
classifyIds
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"埋点记录点击分类次数"
)
@GetMapping
(
"clickClassify"
)
ResponseDto
<?>
clickClassify
(
@CookieValue
(
"userinfo"
)
@ApiParam
(
"cookie信息"
)
String
userInfo
,
@RequestParam
(
"bookGroupId"
)
@ApiParam
(
"社群码id"
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
@ApiParam
(
"群分类id"
)
Long
classifyId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取所有群分类包括已删除的"
)
@GetMapping
(
"getClassifyIngoreDelete"
)
ResponseDto
<?>
getClassifyIngoreDelete
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
@ApiParam
(
"社群码id"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupFacade.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
facade
;
import
com.pcloud.book.group.entity.BookGroupClassify
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.common.page.PageBeanNew
;
import
org.codehaus.jackson.JsonParseException
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -24,6 +26,8 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* Description 社群书群二维码接口
* Created by PENG on 2019/4/17.
...
...
@@ -276,6 +280,14 @@ public interface BookGroupFacade {
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
,
JsonParseException
;
@ApiOperation
(
"删除社群码"
)
@GetMapping
(
"deleteBookGroup"
)
ResponseDto
<?>
deleteBookGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
;
@ApiOperation
(
"根据分类id获取个人二维码"
)
@GetMapping
(
"getOwnAltQrcodeInfoDTOByClassifyId"
)
ResponseDto
<?>
getOwnAltQrcodeInfoDTOByClassifyId
(
...
...
@@ -288,4 +300,70 @@ public interface BookGroupFacade {
ResponseDto
<?>
getAllLargeTemplet
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
,
JsonParseException
;
@ApiOperation
(
"获取社群书数据"
)
@RequestMapping
(
value
=
"getBookGroupStatisByBookGroupId"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getBookGroupStatisByBookGroupId
(
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
)
throws
BizException
;
@ApiOperation
(
value
=
"收益统计--pc"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"groupIncomeStaticParamVO"
,
value
=
"GroupIncomeStaticParamVO"
,
required
=
true
,
dataType
=
"GroupIncomeStaticParamVO"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"getGroupIncomeStatic"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<
PageBeanNew
<
ResourcesStatisticVO
>>
getGroupIncomeStatic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
GroupIncomeStaticParamVO
groupIncomeStaticParamVO
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"社群码浏览趋势图--pc"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"groupScanTrendParamVO"
,
value
=
"GroupScanTrendParamVO"
,
required
=
true
,
dataType
=
"GroupScanTrendParamVO"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"getGroupScanTrend"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<
List
<
GroupScanTrendVO
>>
getGroupScanTrend
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
GroupScanTrendParamVO
groupScanTrendParamVO
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"社群码分类统计--pc"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"bookGroupId"
,
required
=
true
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"currentPage"
,
required
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"numPerPage"
,
required
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getClassifyStatistic"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getClassifyStatistic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
true
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
true
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"社群码分类下的微信群统计--pc"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"bookGroupId"
,
required
=
true
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"classifyId"
,
value
=
"classifyId"
,
required
=
true
,
dataType
=
"Long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getQrcodeStatistic"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getQrcodeStatistic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
Long
classifyId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"资源数据统计--pc"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"bookGroupId"
,
required
=
true
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"classifyId"
,
value
=
"classifyId"
,
required
=
false
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"qrcodeId"
,
value
=
"qrcodeId"
,
required
=
false
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"type"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getTotalRescourceData"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getTotalRescourceData
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
classifyId
,
@RequestParam
(
value
=
"qrcodeId"
,
required
=
false
)
Long
qrcodeId
,
@RequestParam
(
"type"
)
String
type
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"社群码资源收益数据导出--pc"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"bookGroupId"
,
required
=
true
,
dataType
=
"Long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"exportRescourceIncomeData"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
exportRescourceIncomeData
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/GroupQrcodeFacade.java
View file @
3d73fa9d
...
...
@@ -35,6 +35,15 @@ public interface GroupQrcodeFacade {
@RequestMapping
(
value
=
"listQrcodeByClassify"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<
PageBeanNew
>
listQrcodeByClassify
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListQrcodeByClassifyParamVO
listQrcodeByClassifyParamVO
)
throws
PermissionException
;
@ApiOperation
(
value
=
"根据分类获取分类下二维码----不分页"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"bookGroupId"
,
value
=
"bookGroupId"
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"classifyId"
,
value
=
"classifyId"
,
dataType
=
"Long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getQrcodeByClassify"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getQrcodeByClassify
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
Long
classifyId
)
throws
PermissionException
;
@ApiOperation
(
value
=
"修改微信群名称"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/WeixinQrcodeFacade.java
View file @
3d73fa9d
...
...
@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* @author lily
* @date 2019/4/26 15:10
...
...
@@ -38,4 +40,10 @@ public interface WeixinQrcodeFacade {
@GetMapping
(
"getQrStatistics"
)
ResponseDto
<
QrStatisticsVO
>
getQrStatistics
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
;
@GetMapping
(
"getQrStatisticsByVersion"
)
ResponseDto
<
List
<
QrStatisticsVO
>>
getQrStatisticsByVersion
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupClassifyFacadeImpl.java
View file @
3d73fa9d
...
...
@@ -184,6 +184,7 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
return
new
ResponseDto
<>(
bookGroupClassifyBiz
.
listClassifyForLearningReport
(
currentPage
,
numPerPage
,
keyword
,
partyId
));
}
@ApiOperation
(
"拖动排序"
)
@PostMapping
(
"dragSortClassify"
)
@Override
...
...
@@ -196,4 +197,23 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
return
new
ResponseDto
<>();
}
@Override
@GetMapping
(
"clickClassify"
)
public
ResponseDto
<?>
clickClassify
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
Long
classifyId
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
bookGroupClassifyBiz
.
clickClassify
(
wechatUserId
,
bookGroupId
,
classifyId
);
return
new
ResponseDto
<>();
}
@Override
@GetMapping
(
"getClassifyIngoreDelete"
)
public
ResponseDto
<?>
getClassifyIngoreDelete
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
List
<
ListClassifyVO
>
classifyVOS
=
bookGroupClassifyBiz
.
getClassifyIngoreDelete
(
bookGroupId
);
return
new
ResponseDto
<>(
classifyVOS
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
View file @
3d73fa9d
...
...
@@ -17,7 +17,6 @@ import com.pcloud.common.permission.PermissionException;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.codehaus.jackson.JsonParseException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -32,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -397,6 +397,19 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return
new
ResponseDto
<>(
bookGroupBiz
.
getIsShowBookName
(
partyId
));
}
@ApiOperation
(
"删除社群码"
)
@GetMapping
(
"deleteBookGroup"
)
@Override
public
ResponseDto
<?>
deleteBookGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
,
JsonParseException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
bookGroupBiz
.
deleteBookGroup
(
bookGroupId
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"根据分类id获取个人二维码"
)
@GetMapping
(
"getOwnAltQrcodeInfoDTOByClassifyId"
)
@Override
...
...
@@ -421,5 +434,75 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return
new
ResponseDto
<>(
bookGroupBiz
.
getAllLargTemplet
());
}
@Override
@RequestMapping
(
value
=
"getBookGroupStatisByBookGroupId"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getBookGroupStatisByBookGroupId
(
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
)
throws
BizException
{
return
new
ResponseDto
<>(
bookGroupBiz
.
getBookGroupStatisByBookGroupId
(
bookGroupId
));
}
@Override
@RequestMapping
(
value
=
"getGroupIncomeStatic"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<
PageBeanNew
<
ResourcesStatisticVO
>>
getGroupIncomeStatic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
GroupIncomeStaticParamVO
groupIncomeStaticParamVO
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
ResourcesStatisticVO
>
groupIncomeStatic
=
bookGroupBiz
.
getGroupIncomeStatic
(
groupIncomeStaticParamVO
,
adviserId
);
return
new
ResponseDto
<>(
groupIncomeStatic
);
}
@Override
@RequestMapping
(
value
=
"getGroupScanTrend"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<
List
<
GroupScanTrendVO
>>
getGroupScanTrend
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
GroupScanTrendParamVO
groupScanTrendParamVO
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
List
<
GroupScanTrendVO
>
groupScanTrend
=
bookGroupBiz
.
getGroupScanTrend
(
groupScanTrendParamVO
,
adviserId
);
return
new
ResponseDto
<>(
groupScanTrend
);
}
@Override
@RequestMapping
(
value
=
"getClassifyStatistic"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getClassifyStatistic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
true
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
true
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
GroupStatisticVO
>
groupQrcodeStatistic
=
bookGroupBiz
.
getClassifyStatistic
(
bookGroupId
,
adviserId
,
currentPage
,
numPerPage
);
return
new
ResponseDto
<>(
groupQrcodeStatistic
);
}
@Override
@RequestMapping
(
value
=
"getQrcodeStatistic"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getQrcodeStatistic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
Long
classifyId
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
List
<
WxGroupStatisticVO
>
qrcodeStatistic
=
bookGroupBiz
.
getQrcodeStatistic
(
bookGroupId
,
classifyId
,
adviserId
);
return
new
ResponseDto
<>(
qrcodeStatistic
);
}
@Override
@RequestMapping
(
value
=
"getTotalRescourceData"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getTotalRescourceData
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
Long
classifyId
,
@RequestParam
(
value
=
"qrcodeId"
,
required
=
false
)
Long
qrcodeId
,
@RequestParam
(
"type"
)
String
type
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
TotalRescourceDataVO
totalRescourceData
=
bookGroupBiz
.
getTotalRescourceData
(
bookGroupId
,
adviserId
,
classifyId
,
qrcodeId
,
type
);
return
new
ResponseDto
<>(
totalRescourceData
);
}
@Override
@RequestMapping
(
value
=
"exportRescourceIncomeData"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
exportRescourceIncomeData
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
true
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
adviserId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
Map
<
String
,
String
>
resultMap
=
bookGroupBiz
.
exportRescourceIncomeData
(
bookGroupId
,
adviserId
);
return
new
ResponseDto
<>(
resultMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/GroupQrcodeFacadeImpl.java
View file @
3d73fa9d
...
...
@@ -36,6 +36,8 @@ import java.util.Optional;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* @author lily
* @date 2019/4/19 15:36
...
...
@@ -73,6 +75,14 @@ public class GroupQrcodeFacadeImpl implements GroupQrcodeFacade {
}
@Override
@RequestMapping
(
value
=
"getQrcodeByClassify"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getQrcodeByClassify
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
,
@RequestParam
(
"classifyId"
)
Long
classifyId
)
throws
PermissionException
{
List
<
ClassifyQrcodeVO
>
qrcodeByClassify
=
groupQrcodeBiz
.
getQrcodeByClassify
(
bookGroupId
,
classifyId
);
return
new
ResponseDto
<>(
qrcodeByClassify
);
}
@Override
@PostMapping
(
"modifyWechatGroupName"
)
@ApiOperation
(
"修改微信群名称"
)
public
ResponseDto
<?>
modifyWechatGroupName
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
WechatGroupNameVO
wechatGroupNameVO
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/WeixinQrcodeFacadeImpl.java
View file @
3d73fa9d
...
...
@@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* @author lily
* @date 2019/4/26 15:10
...
...
@@ -44,4 +46,11 @@ public class WeixinQrcodeFacadeImpl implements WeixinQrcodeFacade {
throws
BizException
{
return
new
ResponseDto
<>(
weixinQrcodeBiz
.
getQrStatistics
());
}
@Override
@GetMapping
(
"getQrStatisticsByVision"
)
@ApiOperation
(
"平台端按照版本获取二维码统计数据"
)
public
ResponseDto
<
List
<
QrStatisticsVO
>>
getQrStatisticsByVersion
(
String
token
)
throws
BizException
{
return
new
ResponseDto
<>(
weixinQrcodeBiz
.
getQrStatisticsByVersion
());
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupClassifyServiceImpl.java
View file @
3d73fa9d
...
...
@@ -43,6 +43,13 @@ public class BookGroupClassifyServiceImpl implements BookGroupClassifyService {
}
@Override
@PostMapping
(
"getClassifyByIds"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
String
>>>
getClassifyByIds
(
@RequestBody
List
<
Long
>
weixinGroupClassifyPrimaryIds
)
{
Map
<
Long
,
String
>
groupClassifyMap
=
bookGroupClassifyBiz
.
getClassifyByIds
(
weixinGroupClassifyPrimaryIds
);
return
ResponseHandleUtil
.
toResponse
(
groupClassifyMap
);
}
@Override
@PostMapping
(
"listGroupQrcodeBaseInfo"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
GroupQrcodeBaseDTO
>>>
listGroupQrcodeBaseInfo
(
@RequestBody
List
<
String
>
weixinGroupIds
)
{
Map
<
String
,
GroupQrcodeBaseDTO
>
groupQrcodeMap
=
bookGroupClassifyBiz
.
listGroupQrcodeBaseInfo
(
weixinGroupIds
);
...
...
@@ -96,4 +103,11 @@ public class BookGroupClassifyServiceImpl implements BookGroupClassifyService {
public
ResponseEntity
<
ResponseDto
<
BigDecimal
>>
getPayPrice
(
@RequestParam
(
"qrcodeId"
)
Long
qrcodeId
,
@RequestParam
(
"wxUserId"
)
String
wxUserId
)
{
return
ResponseHandleUtil
.
toResponse
(
bookGroupClassifyBiz
.
getPayPrice
(
qrcodeId
,
wxUserId
));
}
@Override
@PostMapping
(
"getGroupClassifyCount"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
BookClassifyDTO
>>>
getGroupClassifyCount
(
@RequestBody
List
<
Long
>
bookIds
)
{
Map
<
Long
,
BookClassifyDTO
>
groupClassifyCount
=
bookGroupClassifyBiz
.
getGroupClassifyCount
(
bookIds
);
return
ResponseHandleUtil
.
toResponse
(
groupClassifyCount
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
3d73fa9d
...
...
@@ -3,11 +3,12 @@ package com.pcloud.book.group.service.impl;
import
java.util.List
;
import
java.util.Map
;
import
com.pcloud.book.group.dto.PersonalQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupCipherDTO
;
import
com.pcloud.book.group.dto.GroupUseDTO
;
import
io.swagger.annotations.ApiOperation
;
import
com.pcloud.book.group.dto.ResourceBrowseParamDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -88,6 +89,7 @@ public class BookGroupServiceImpl implements BookGroupService {
}
@Override
@RequestMapping
(
value
=
"updatePersonQrcode"
,
method
=
RequestMethod
.
POST
)
public
void
updatePersonQrcode
(
@RequestBody
PersonalQrcodeDTO
personalQrcodeDTO
)
throws
BizException
{
...
...
@@ -131,4 +133,16 @@ public class BookGroupServiceImpl implements BookGroupService {
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
getJoinGroupCipher
(
cipher
));
}
/**
* @description 获取资源浏览数据
* @author 戴兴
* @date 2019/8/8 20:45
*/
@Override
@PostMapping
(
"getResourcesBrowseCount"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
Long
>>>
getResourcesBrowseCount
(
@RequestBody
ResourceBrowseParamDto
resourceBrowseParamDto
)
{
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
getResourcesBrowseCount
(
resourceBrowseParamDto
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/WeixinQrcodeServiceImpl.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
service
.
impl
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
import
com.pcloud.book.group.dto.BookWxQrcodeDTO
;
import
com.pcloud.book.group.dto.SyncWeixinGroupIdDTO
;
...
...
@@ -7,8 +8,10 @@ import com.pcloud.book.group.dto.UpdateQrDTO;
import
com.pcloud.book.group.dto.WeixinQrcodeCountDTO
;
import
com.pcloud.book.group.dto.WeixinQrcodeDTO
;
import
com.pcloud.book.group.service.WeixinQrcodeService
;
import
com.pcloud.book.group.vo.ClassifyQrcodeVO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -35,6 +38,8 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService {
@Autowired
private
WeixinQrcodeBiz
weixinQrcodeBiz
;
@Autowired
private
GroupQrcodeBiz
groupQrcodeBiz
;
@Override
@GetMapping
(
"tenQuartz"
)
...
...
@@ -117,4 +122,15 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService {
return
ResponseHandleUtil
.
toResponse
(
weixinQrcodeBiz
.
getGroupVersion
(
wxGroupIds
));
}
@Override
@RequestMapping
(
value
=
"getWxGroupId"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
<
ResponseDto
<
String
>>
getWxGroupId
(
@RequestParam
(
"classifyId"
)
Long
classifyId
)
{
List
<
ClassifyQrcodeVO
>
qrcodeByClassify
=
groupQrcodeBiz
.
getQrcodeByClassify
(
null
,
classifyId
);
String
wxGroupId
=
null
;
if
(!
ListUtils
.
isEmpty
(
qrcodeByClassify
)){
wxGroupId
=
qrcodeByClassify
.
get
(
0
).
getWeixinGroupId
();
}
return
ResponseHandleUtil
.
toResponse
(
wxGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
3d73fa9d
...
...
@@ -16,7 +16,6 @@ import com.pcloud.common.utils.ListUtils;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.sdk.wxgroup.ChangeNameVO
;
import
com.sdk.wxgroup.QrcodeVO
;
import
com.sdk.wxgroup.SendArticleMessageVO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendPicMessageVO
;
...
...
@@ -27,7 +26,11 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author lily
...
...
@@ -37,11 +40,12 @@ public class SendWeixinRequestTools {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SendWeixinRequestTools
.
class
);
@ParamLog
(
"修改微信群名称"
)
public
static
void
changeGroupName
(
String
robotWxId
,
String
weixinGroupId
,
String
groupName
)
{
public
static
void
changeGroupName
(
String
robotWxId
,
String
weixinGroupId
,
String
groupName
,
String
ip
)
{
ChangeNameVO
changeNameVO
=
new
ChangeNameVO
();
changeNameVO
.
setAltId
(
robotWxId
);
changeNameVO
.
setWxGroupId
(
weixinGroupId
);
changeNameVO
.
setName
(
groupName
);
changeNameVO
.
setIp
(
ip
);
try
{
WxGroupSDK
.
changeGroupName
(
changeNameVO
);
}
catch
(
Exception
e
)
{
...
...
@@ -273,11 +277,25 @@ public class SendWeixinRequestTools {
return
resultUrl
;
}
@ParamLog
(
"欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfo
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWx
Id
,
String
ip
){
@ParamLog
(
"
群
欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfo
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
weixinGroup
Id
,
String
ip
){
if
(
ListUtils
.
isEmpty
(
keywords
))
{
return
;
}
final
String
content
=
processContent
(
keywords
,
robotId
,
weixinGroupId
,
ip
);
sendTextMessage
(
content
,
robotId
,
weixinGroupId
,
ip
);
}
@ParamLog
(
"个人欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfoToSelf
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWxId
,
String
ip
){
if
(
ListUtils
.
isEmpty
(
keywords
))
{
return
;
}
final
String
content
=
processContent
(
keywords
,
robotId
,
toWxId
,
ip
);
sendTextMessageToSelf
(
content
,
robotId
,
toWxId
,
ip
);
}
private
static
String
processContent
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWxId
,
String
ip
)
{
StringBuilder
content
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
keywords
.
size
();
i
++)
{
KeywordDTO
keywordDTO
=
keywords
.
get
(
i
);
...
...
@@ -292,9 +310,7 @@ public class SendWeixinRequestTools {
content
.
append
(
"\n"
);
}
}
// 1001282-施总需求,群不推送关键词,个人欢迎语推送关键词
// sendTextMessage(content, robotId, weixinGroupId, ip);
sendTextMessageToSelf
(
content
.
toString
(),
robotId
,
toWxId
,
ip
);
return
content
.
toString
();
}
private
static
void
sendTextMessageToSelf
(
String
content
,
String
robotId
,
String
toWxId
,
String
ip
){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/BookGroupClassifyVO.java
View file @
3d73fa9d
...
...
@@ -30,6 +30,9 @@ public class BookGroupClassifyVO {
@ApiModelProperty
(
"群二维码名称"
)
private
String
groupQrcodeName
;
@ApiModelProperty
(
"群数量"
)
private
Integer
groupsCount
;
@ApiModelProperty
(
"群人数"
)
private
Integer
userNumber
;
...
...
@@ -102,6 +105,14 @@ public class BookGroupClassifyVO {
this
.
groupQrcodeName
=
groupQrcodeName
;
}
public
Integer
getGroupsCount
()
{
return
groupsCount
;
}
public
void
setGroupsCount
(
Integer
groupsCount
)
{
this
.
groupsCount
=
groupsCount
;
}
public
Integer
getUserNumber
()
{
return
userNumber
;
}
...
...
@@ -175,6 +186,7 @@ public class BookGroupClassifyVO {
", classify='"
+
classify
+
'\''
+
", bookGroupId='"
+
bookGroupId
+
'\''
+
", groupQrcodeName='"
+
groupQrcodeName
+
'\''
+
", groupsCount="
+
groupsCount
+
", userNumber="
+
userNumber
+
", weekActiveNumber="
+
weekActiveNumber
+
", proLabelId="
+
proLabelId
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ClassifyQrcodeVO.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -44,6 +46,13 @@ public class ClassifyQrcodeVO implements Serializable {
@ApiModelProperty
(
"关键词识别次数"
)
private
Integer
keywordCount
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"关键词识别次数"
)
private
Date
createdTime
;
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
...
...
@@ -124,6 +133,18 @@ public class ClassifyQrcodeVO implements Serializable {
this
.
keywordCount
=
keywordCount
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
@Override
public
String
toString
()
{
return
"ClassifyQrcodeVO{"
+
...
...
@@ -136,7 +157,8 @@ public class ClassifyQrcodeVO implements Serializable {
", quitRate="
+
quitRate
+
", weixinQrcodeId="
+
weixinQrcodeId
+
", weixinGroupId='"
+
weixinGroupId
+
'\''
+
", keywordCount='"
+
keywordCount
+
'\''
+
", keywordCount="
+
keywordCount
+
", createdTime="
+
createdTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/GroupIncomeStaticParamVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/25 19:35
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupIncomeStaticParamVO
implements
Serializable
{
private
Long
bookGroupId
;
private
Integer
currentPage
;
private
Integer
numPerPage
;
private
String
type
;
private
Long
classifyId
;
private
Long
wxGroupId
;
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Integer
getCurrentPage
()
{
return
currentPage
;
}
public
void
setCurrentPage
(
Integer
currentPage
)
{
this
.
currentPage
=
currentPage
;
}
public
Integer
getNumPerPage
()
{
return
numPerPage
;
}
public
void
setNumPerPage
(
Integer
numPerPage
)
{
this
.
numPerPage
=
numPerPage
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getWxGroupId
()
{
return
wxGroupId
;
}
public
void
setWxGroupId
(
Long
wxGroupId
)
{
this
.
wxGroupId
=
wxGroupId
;
}
@Override
public
String
toString
()
{
return
"GroupIncomeStaticParamVO{"
+
"bookGroupId="
+
bookGroupId
+
", currentPage="
+
currentPage
+
", numPerPage="
+
numPerPage
+
", type="
+
type
+
", classifyId="
+
classifyId
+
", wxGroupId="
+
wxGroupId
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/GroupScanTrendParamVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/25 19:57
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupScanTrendParamVO
implements
Serializable
{
private
Long
bookGroupId
;
private
Long
classifyId
;
private
Long
wxGroupId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startDate
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endDate
;
private
Integer
dayNum
;
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getWxGroupId
()
{
return
wxGroupId
;
}
public
void
setWxGroupId
(
Long
wxGroupId
)
{
this
.
wxGroupId
=
wxGroupId
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getStartDate
()
{
return
startDate
;
}
public
void
setStartDate
(
Date
startDate
)
{
this
.
startDate
=
startDate
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getEndDate
()
{
return
endDate
;
}
public
void
setEndDate
(
Date
endDate
)
{
this
.
endDate
=
endDate
;
}
public
Integer
getDayNum
()
{
return
dayNum
;
}
public
void
setDayNum
(
Integer
dayNum
)
{
this
.
dayNum
=
dayNum
;
}
@Override
public
String
toString
()
{
return
"GroupScanTrendParamVO{"
+
"bookGroupId="
+
bookGroupId
+
", classifyId="
+
classifyId
+
", wxGroupId="
+
wxGroupId
+
", startDate="
+
startDate
+
", endDate="
+
endDate
+
", dayNum="
+
dayNum
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/GroupScanTrendVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/26 9:05
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupScanTrendVO
implements
Serializable
{
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
date
;
private
Long
buyCount
;
private
Long
scanCount
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
public
Date
getDate
()
{
return
date
;
}
public
void
setDate
(
Date
date
)
{
this
.
date
=
date
;
}
public
Long
getBuyCount
()
{
return
buyCount
;
}
public
void
setBuyCount
(
Long
buyCount
)
{
this
.
buyCount
=
buyCount
;
}
public
Long
getScanCount
()
{
return
scanCount
;
}
public
void
setScanCount
(
Long
scanCount
)
{
this
.
scanCount
=
scanCount
;
}
@Override
public
String
toString
()
{
return
"GroupScanTrendVO{"
+
"date="
+
date
+
", buyCount="
+
buyCount
+
", scanCount="
+
scanCount
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/GroupStatisticVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/28 15:45
*/
public
class
GroupStatisticVO
implements
Serializable
{
@ApiModelProperty
(
"分类唯一标识"
)
private
Long
classifyId
;
@ApiModelProperty
(
"分类名称"
)
private
String
classifyName
;
@ApiModelProperty
(
"是否免费,1-免费 0-收费"
)
private
Integer
isFree
;
@ApiModelProperty
(
"价格"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"点击人数"
)
private
Long
clickCount
;
@ApiModelProperty
(
"累计进群人数"
)
private
Long
inGroupPersonCount
;
@ApiModelProperty
(
"当前群人数"
)
private
Long
groupPersonCount
;
@ApiModelProperty
(
"收益"
)
private
BigDecimal
income
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createdTime
;
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
String
getClassifyName
()
{
return
classifyName
;
}
public
void
setClassifyName
(
String
classifyName
)
{
this
.
classifyName
=
classifyName
;
}
public
Integer
getIsFree
()
{
return
isFree
;
}
public
void
setIsFree
(
Integer
isFree
)
{
this
.
isFree
=
isFree
;
}
public
Long
getClickCount
()
{
return
clickCount
;
}
public
void
setClickCount
(
Long
clickCount
)
{
this
.
clickCount
=
clickCount
;
}
public
Long
getInGroupPersonCount
()
{
return
inGroupPersonCount
;
}
public
void
setInGroupPersonCount
(
Long
inGroupPersonCount
)
{
this
.
inGroupPersonCount
=
inGroupPersonCount
;
}
public
Long
getGroupPersonCount
()
{
return
groupPersonCount
;
}
public
void
setGroupPersonCount
(
Long
groupPersonCount
)
{
this
.
groupPersonCount
=
groupPersonCount
;
}
public
BigDecimal
getIncome
()
{
return
income
;
}
public
void
setIncome
(
BigDecimal
income
)
{
this
.
income
=
income
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
@Override
public
String
toString
()
{
return
"GroupStatisticVO{"
+
"classifyId="
+
classifyId
+
", classifyName="
+
classifyName
+
", isFree="
+
isFree
+
", clickCount="
+
clickCount
+
", inGroupPersonCount="
+
inGroupPersonCount
+
", groupPersonCount="
+
groupPersonCount
+
", income="
+
income
+
", createdTime="
+
createdTime
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ListClassifyVO.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -42,6 +44,13 @@ public class ListClassifyVO implements Serializable {
@ApiModelProperty
(
"排序"
)
private
Integer
rank
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createdTime
;
public
Integer
getRank
()
{
return
rank
;
}
...
...
@@ -114,9 +123,21 @@ public class ListClassifyVO implements Serializable {
this
.
qrcodeNumber
=
qrcodeNumber
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
@Override
public
String
toString
()
{
return
"
ClassifyName
VO{"
+
return
"
ListClassify
VO{"
+
"id="
+
id
+
", classify='"
+
classify
+
'\''
+
", classifyIntroduce='"
+
classifyIntroduce
+
'\''
+
...
...
@@ -125,6 +146,7 @@ public class ListClassifyVO implements Serializable {
", qrcodeNumber="
+
qrcodeNumber
+
", userNumberTotal="
+
userNumberTotal
+
", rank="
+
rank
+
", createdTime="
+
createdTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/QrStatisticsVO.java
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
java.io.Serializable
;
import
java.util.Map
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author 戴兴
* @description TODO
* @date 2019/2/28 18:15
*/
@Data
public
class
QrStatisticsVO
implements
Serializable
{
@ApiModelProperty
(
"所有个数"
)
...
...
@@ -20,36 +23,6 @@ public class QrStatisticsVO implements Serializable {
@ApiModelProperty
(
"未使用的个数"
)
private
Integer
notUseCount
;
public
Integer
getAllCount
()
{
return
allCount
;
}
public
void
setAllCount
(
Integer
allCount
)
{
this
.
allCount
=
allCount
;
}
public
Integer
getInUseCount
()
{
return
inUseCount
;
}
public
void
setInUseCount
(
Integer
inUseCount
)
{
this
.
inUseCount
=
inUseCount
;
}
public
Integer
getNotUseCount
()
{
return
notUseCount
;
}
public
void
setNotUseCount
(
Integer
notUseCount
)
{
this
.
notUseCount
=
notUseCount
;
}
@Override
public
String
toString
()
{
return
"QrStatisticsVO{"
+
"allCount="
+
allCount
+
", inUseCount="
+
inUseCount
+
", notUseCount="
+
notUseCount
+
'}'
;
}
@ApiModelProperty
(
"QR版本"
)
private
Integer
version
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourceClickVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
java.io.Serializable
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/27 17:19
*/
public
class
ResourceClickVO
implements
Serializable
{
private
Long
rescourceId
;
private
Long
clickCount
;
public
Long
getRescourceId
()
{
return
rescourceId
;
}
public
void
setRescourceId
(
Long
rescourceId
)
{
this
.
rescourceId
=
rescourceId
;
}
public
Long
getClickCount
()
{
return
clickCount
;
}
public
void
setClickCount
(
Long
clickCount
)
{
this
.
clickCount
=
clickCount
;
}
@Override
public
String
toString
()
{
return
"ResourceClickVO{"
+
"rescourceId="
+
rescourceId
+
", clickCount="
+
clickCount
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcesStatisticVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/25 19:01
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
ResourcesStatisticVO
implements
Serializable
{
private
Long
rescourceId
;
private
String
rescourceName
;
private
String
type
;
private
Long
browseCount
;
private
Long
saleCount
;
private
BigDecimal
totalSale
;
private
BigDecimal
totalIncome
;
public
Long
getRescourceId
()
{
return
rescourceId
;
}
public
void
setRescourceId
(
Long
rescourceId
)
{
this
.
rescourceId
=
rescourceId
;
}
public
String
getRescourceName
()
{
return
rescourceName
;
}
public
void
setRescourceName
(
String
rescourceName
)
{
this
.
rescourceName
=
rescourceName
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Long
getBrowseCount
()
{
return
browseCount
;
}
public
void
setBrowseCount
(
Long
browseCount
)
{
this
.
browseCount
=
browseCount
;
}
public
Long
getSaleCount
()
{
return
saleCount
;
}
public
void
setSaleCount
(
Long
saleCount
)
{
this
.
saleCount
=
saleCount
;
}
public
BigDecimal
getTotalSale
()
{
return
totalSale
;
}
public
void
setTotalSale
(
BigDecimal
totalSale
)
{
this
.
totalSale
=
totalSale
;
}
public
BigDecimal
getTotalIncome
()
{
return
totalIncome
;
}
public
void
setTotalIncome
(
BigDecimal
totalIncome
)
{
this
.
totalIncome
=
totalIncome
;
}
@Override
public
String
toString
()
{
return
"ResourcesStatisticVO{"
+
"rescourceId='"
+
rescourceId
+
'\''
+
", rescourceName="
+
rescourceName
+
", type='"
+
type
+
'\''
+
", browseCount="
+
browseCount
+
", saleCount="
+
saleCount
+
", totalSale="
+
totalSale
+
", totalIncome="
+
totalIncome
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/TotalRescourceDataVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/28 16:16
*/
public
class
TotalRescourceDataVO
implements
Serializable
{
private
Long
clickCount
;
private
BigDecimal
totalSale
;
private
BigDecimal
totalIncome
;
public
Long
getClickCount
()
{
return
clickCount
;
}
public
void
setClickCount
(
Long
clickCount
)
{
this
.
clickCount
=
clickCount
;
}
public
BigDecimal
getTotalSale
()
{
return
totalSale
;
}
public
void
setTotalSale
(
BigDecimal
totalSale
)
{
this
.
totalSale
=
totalSale
;
}
public
BigDecimal
getTotalIncome
()
{
return
totalIncome
;
}
public
void
setTotalIncome
(
BigDecimal
totalIncome
)
{
this
.
totalIncome
=
totalIncome
;
}
@Override
public
String
toString
()
{
return
"TotalRescourceDataVO{"
+
"clickCount="
+
clickCount
+
", totalSale="
+
totalSale
+
", totalIncome="
+
totalIncome
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/WxGroupStatisticVO.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @author 戴兴
* @description TODO
* @date 2019/7/28 15:47
*/
public
class
WxGroupStatisticVO
implements
Serializable
{
private
Long
qrcodeId
;
private
String
wxGroupName
;
private
Long
inGroupPersonCount
;
private
Long
groupPersonCount
;
private
BigDecimal
income
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createdTime
;
public
Long
getQrcodeId
()
{
return
qrcodeId
;
}
public
void
setQrcodeId
(
Long
qrcodeId
)
{
this
.
qrcodeId
=
qrcodeId
;
}
public
String
getWxGroupName
()
{
return
wxGroupName
;
}
public
void
setWxGroupName
(
String
wxGroupName
)
{
this
.
wxGroupName
=
wxGroupName
;
}
public
Long
getInGroupPersonCount
()
{
return
inGroupPersonCount
;
}
public
void
setInGroupPersonCount
(
Long
inGroupPersonCount
)
{
this
.
inGroupPersonCount
=
inGroupPersonCount
;
}
public
Long
getGroupPersonCount
()
{
return
groupPersonCount
;
}
public
void
setGroupPersonCount
(
Long
groupPersonCount
)
{
this
.
groupPersonCount
=
groupPersonCount
;
}
public
BigDecimal
getIncome
()
{
return
income
;
}
public
void
setIncome
(
BigDecimal
income
)
{
this
.
income
=
income
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
@Override
public
String
toString
()
{
return
"WxGroupStatisticVO{"
+
"qrcodeId="
+
qrcodeId
+
", wxGroupName='"
+
wxGroupName
+
'\''
+
", inGroupPersonCount="
+
inGroupPersonCount
+
", groupPersonCount="
+
groupPersonCount
+
", income="
+
income
+
", createdTime="
+
createdTime
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
3d73fa9d
...
...
@@ -15,11 +15,7 @@ import com.pcloud.book.group.dao.BookGroupClassifyDao;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dao.JoinGroupCipherDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeDTO
;
import
com.pcloud.book.group.dto.JoinGroupCipherDTO
;
import
com.pcloud.book.group.dto.PushAddUserMessageDTO
;
import
com.pcloud.book.group.dto.*
;
import
com.pcloud.book.group.entity.AppTouchRecord
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.enums.TouchTypeEnum
;
...
...
@@ -42,6 +38,8 @@ import com.pcloud.book.keywords.vo.ReplyMessageVO;
import
com.pcloud.book.keywords.vo.SetGuideVO
;
import
com.pcloud.book.keywords.vo.UpdateGuideVO
;
import
com.pcloud.book.util.properties.BookProps
;
import
com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.ListUtils
;
...
...
@@ -106,6 +104,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
private
JoinGroupCipherDao
joinGroupCipherDao
;
@Autowired
private
KeywordDao
keywordDao
;
@Autowired
private
WeixinClockGroupClassifyDao
weixinClockGroupClassifyDao
;
@ParamLog
(
"同意加好友发送欢迎语"
)
@Override
...
...
@@ -144,7 +144,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
//发主打资源
sendMainKeyword
(
keywords
,
agreeAddUserDTO
,
dto
,
wxGroupId
);
//发关键词列表
SendWeixinRequestTools
.
sendKeywordsInfo
(
keywords
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
SendWeixinRequestTools
.
sendKeywordsInfo
ToSelf
(
keywords
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
// 拉群
final
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
wxGroupId
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getIp
());
// 邀请好友进群有次数限制,目前测试为每天只能拉30-40人就操作频繁,所以在此加判断,超过30人或者群人数超过30人就发送邀请链接
...
...
@@ -161,6 +161,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
sendGroupInviteVO
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
sendGroupInviteVO
.
setWxId
(
agreeAddUserDTO
.
getUserWxId
());
sendGroupInviteVO
.
setWxGroupId
(
wxGroupId
);
sendGroupInviteVO
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendGroupInvite
(
sendGroupInviteVO
);
log
.
info
(
"[同意加好友发送欢迎语] 发送进群链接 sendGroupInviteVO:{}"
,
sendGroupInviteVO
);
// 进群之后更新群qrCodeId
...
...
@@ -366,14 +367,16 @@ public class BookGuideBizImpl implements BookGuideBiz {
//获取公众号基本信息
AccountSettingDto
wechatInfo
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
//获取关键词信息(改成10个了) 刘娜需求 1001282 群不推送关键词
// List<KeywordDTO> keywords = bookKeywordBiz.listFiveKeyword(classifyQrcodeInfo.getClassifyId(), classifyQrcodeInfo.getBookGroupId());
// Boolean isHaveKeywords = !ListUtils.isEmpty(keywords);
List
<
KeywordDTO
>
keywords
=
bookKeywordBiz
.
listFiveKeyword
(
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getBookGroupId
());
Boolean
isHaveKeywords
=
!
ListUtils
.
isEmpty
(
keywords
);
final
Boolean
groupRobot
=
wechatGroupConsr
.
isGroupRobot
(
robotId
);
log
.
info
(
"[wechatGroupConsr.isGroupRobot] robotId:{} groupRobot:{}"
,
robotId
,
groupRobot
);
if
(
ListUtils
.
isEmpty
(
replyMessages
))
{
//获取群名称
GroupQrcodeBaseInfoVO
groupInfo
=
groupQrcodeBiz
.
getBaseById
(
classifyQrcodeInfo
.
getGroupQrcodeId
());
//推送消息 刘娜需求 1001282 群不推送关键词
// SendWeixinRequestTools.sendDefaultMessage(groupInfo == null ? "" : groupInfo.getGroupName(), robotId, weixinGroupId, isHaveKeywords, pushAddUserMessageDTO.getIp());
SendWeixinRequestTools
.
sendDefaultMessage
(
groupInfo
==
null
?
""
:
groupInfo
.
getGroupName
(),
robotId
,
weixinGroupId
,
false
,
pushAddUserMessageDTO
.
getIp
());
// 若非之前的机器人则不回复普通关键词
SendWeixinRequestTools
.
sendDefaultMessage
(
groupInfo
==
null
?
""
:
groupInfo
.
getGroupName
(),
robotId
,
weixinGroupId
,
isHaveKeywords
,
pushAddUserMessageDTO
.
getIp
());
}
else
{
//处理链接
handleUrl
(
replyMessages
,
wechatInfo
,
classifyQrcodeInfo
);
...
...
@@ -383,7 +386,9 @@ public class BookGuideBizImpl implements BookGuideBiz {
addGuideAppTouchRecord
(
replyMessages
,
weixinGroupId
,
classifyQrcodeInfo
.
getBookGroupId
(),
classifyQrcodeInfo
.
getClassifyId
());
}
//获取关键词信息(改成10个了)刘娜需求 1001282 群不推送关键词
// SendWeixinRequestTools.sendKeywordsInfo(keywords, robotId, weixinGroupId, pushAddUserMessageDTO.getIp());
if
(
groupRobot
)
{
SendWeixinRequestTools
.
sendKeywordsInfo
(
keywords
,
robotId
,
weixinGroupId
,
pushAddUserMessageDTO
.
getIp
());
}
//如果设置了群学习报告,加一个群学习报告的关键词
pushLearningReport
(
classifyQrcodeInfo
,
robotId
,
weixinGroupId
,
pushAddUserMessageDTO
.
getIp
());
if
(
bookGuide
!=
null
&&
bookGuide
.
getIsRecommend
()
!=
null
&&
bookGuide
.
getIsRecommend
()
==
1
)
{
...
...
@@ -391,7 +396,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
SendWeixinRequestTools
.
sendAccountMessage
(
weixinGroupId
,
bookGuide
.
getRecommendLanguage
(),
robotId
,
wechatInfo
,
pushAddUserMessageDTO
.
getIp
());
}
//校验该群是否与微信群打卡有关
List
<
Long
>
bookClockInfoIdList
=
bookClockCheck
.
checkGroupIsClock
(
classifyQrcodeInfo
);
/*
List<Long> bookClockInfoIdList = bookClockCheck.checkGroupIsClock(classifyQrcodeInfo);
if(!ListUtils.isEmpty(bookClockInfoIdList)){
Map<String,Object> paramMap = new HashMap<>();
int i = 0;
...
...
@@ -414,13 +419,14 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
}
}
}
*/
}
@ParamLog
(
"推关学习报告/猜谜语关键词消息"
)
private
void
pushLearningReport
(
GroupClassifyQrcodeDTO
classifyQrcodeInfo
,
String
robotId
,
String
weixinGroupId
,
String
ip
)
{
Boolean
reportOpen
=
false
;
Boolean
riddleOpen
=
false
;
Boolean
clockOpen
=
false
;
if
(
classifyQrcodeInfo
.
getHasOpenLearningReport
()
!=
null
&&
classifyQrcodeInfo
.
getHasOpenLearningReport
())
{
reportOpen
=
true
;
}
...
...
@@ -428,9 +434,25 @@ public class BookGuideBizImpl implements BookGuideBiz {
if
(
null
!=
groupQrcode
&&
groupQrcode
.
getRiddleOpen
())
{
riddleOpen
=
true
;
}
if
(
reportOpen
&&
riddleOpen
)
{
WeixinClockDto
weixinClockDto
=
weixinClockGroupClassifyDao
.
getClockBaseInfoByClassify
(
classifyQrcodeInfo
.
getClassifyId
());
if
(
null
!=
weixinClockDto
&&
!
StringUtil
.
isEmpty
(
weixinClockDto
.
getClockGuide
())
&&
!
StringUtil
.
isEmpty
(
weixinClockDto
.
getClockKeyword
()))
{
clockOpen
=
true
;
}
if
(
reportOpen
&&
riddleOpen
&&
clockOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值\n"
+
"关键词【猜谜语】\n 猜谜语,大家一起玩,看谁666\n"
+
"关键词【"
+
weixinClockDto
.
getClockKeyword
()
+
"】\n "
+
weixinClockDto
.
getClockGuide
(),
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
reportOpen
&&
riddleOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值\n"
+
"关键词【猜谜语】\n 猜谜语,大家一起玩,看谁666"
,
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
reportOpen
&&
clockOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值\n"
+
"关键词【"
+
weixinClockDto
.
getClockKeyword
()
+
"】\n "
+
weixinClockDto
.
getClockGuide
(),
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
riddleOpen
&&
clockOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【猜谜语】\n 猜谜语,大家一起玩,看谁666"
+
"关键词【"
+
weixinClockDto
.
getClockKeyword
()
+
"】\n "
+
weixinClockDto
.
getClockGuide
(),
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
clockOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【"
+
weixinClockDto
.
getClockKeyword
()
+
"】\n "
+
weixinClockDto
.
getClockGuide
(),
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
reportOpen
)
{
SendWeixinRequestTools
.
sendTextMessage
(
"关键词【学习报告】\n 获取个人专属学习报告,与群成员PK元气值"
,
robotId
,
weixinGroupId
,
ip
);
}
else
if
(
riddleOpen
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
3d73fa9d
...
...
@@ -38,7 +38,14 @@ import com.pcloud.book.keywords.entity.BookKeyword;
import
com.pcloud.book.keywords.entity.BookKeywordRecord
;
import
com.pcloud.book.keywords.entity.Keyword
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.vo.*
;
import
com.pcloud.book.keywords.vo.DeleteKeywordVO
;
import
com.pcloud.book.keywords.vo.KeywordVO
;
import
com.pcloud.book.keywords.vo.ListKeywordParam
;
import
com.pcloud.book.keywords.vo.ListKeywordVO
;
import
com.pcloud.book.keywords.vo.QrWeixinParam
;
import
com.pcloud.book.keywords.vo.SetKeywordVO
;
import
com.pcloud.book.keywords.vo.SetRankVO
;
import
com.pcloud.book.keywords.vo.UpdateKeywordVO
;
import
com.pcloud.channelcenter.base.constants.ChannelEnum
;
import
com.pcloud.channelcenter.qrcode.service.QrcodeSceneService
;
import
com.pcloud.channelcenter.qrcode.vo.MessageBookVO
;
...
...
@@ -71,7 +78,6 @@ import java.util.ArrayList;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -480,13 +486,15 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
// 处理链接地址
Long
classifyId
=
keywordClassifyIdMap
.
get
(
replyKeywordDTO
.
getKeywordId
());
final
GroupClassifyQrcodeDTO
dto
=
classifyMap
.
get
(
classifyId
);
if
(
null
==
dto
)
{
log
.
info
(
"[关键词消息回复] 分类信息为空 replyKeywordDTO:{}; classifyMap:{}"
,
replyKeywordDTO
,
classifyMap
);
continue
;
}
final
boolean
isApp
=
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
());
final
boolean
isLink
=
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
());
Long
qrcodeId
=
classifyToQrcodeMap
.
get
(
dto
.
getClassifyId
());
GroupQrcodeBaseInfoVO
qrcodeInfo
=
groupQrcodeDao
.
getBaseById
(
qrcodeId
);
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
())
||
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
()))
{
if
(
null
==
dto
)
{
log
.
info
(
"[关键词消息回复] 分类信息为空 replyKeywordDTO:{}; classifyMap:{}"
,
replyKeywordDTO
,
classifyMap
);
continue
;
}
if
(
isApp
||
isLink
)
{
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
dto
.
getChannelId
());
String
linkUrl
=
SendWeixinRequestTools
.
splitUrlNew
(
accountSettingDto
,
replyKeywordDTO
.
getLinkUrl
(),
dto
.
getBookGroupId
(),
dto
.
getClassifyId
(),
qrcodeId
);
replyKeywordDTO
.
setLinkUrl
(
linkUrl
);
...
...
@@ -523,7 +531,6 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
sb
.
append
(
dto
.
getKeywords
()).
append
(
":"
).
append
(
dto
.
getContent
()).
append
(
"\n"
);
}
else
if
(
ReplyTypeEnum
.
IMAGE
.
value
.
equals
(
dto
.
getReplyType
()))
{
SendWeixinRequestTools
.
sendKeywordMessage
(
dto
,
robotId
,
userWxId
,
ip
,
code
);
continue
;
}
}
d
.
setContent
(
sb
.
toString
());
...
...
@@ -579,7 +586,9 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
log
.
info
(
"[关键词回复原始数据] : sendKeywordMessage replyKeywordDTO :{}, robotId:{}, weixinGroupId:{}"
,
replyKeywordDTO
,
robotId
,
weixinGroupId
);
// 处理链接地址
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
())
||
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
()))
{
final
boolean
isApp
=
ReplyTypeEnum
.
APP
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
());
final
boolean
isLink
=
ReplyTypeEnum
.
LINK
.
value
.
equals
(
replyKeywordDTO
.
getReplyType
());
if
(
isApp
||
isLink
)
{
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
String
linkUrl
=
SendWeixinRequestTools
.
splitUrlNew
(
accountSettingDto
,
replyKeywordDTO
.
getLinkUrl
(),
classifyQrcodeInfo
.
getBookGroupId
(),
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getGroupQrcodeId
());
replyKeywordDTO
.
setLinkUrl
(
linkUrl
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dto/ReplyKeywordDTO.java
View file @
3d73fa9d
...
...
@@ -48,4 +48,10 @@ public class ReplyKeywordDTO implements Serializable {
@ApiModelProperty
(
"短链接地址"
)
private
String
shortLinkUrl
;
@ApiModelProperty
(
"应用/作品id"
)
private
Long
serveId
;
@ApiModelProperty
(
"应用/作品"
)
private
String
serveType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
View file @
3d73fa9d
...
...
@@ -75,4 +75,9 @@ public class MQTopicConumer {
*/
public
static
final
String
WX_AGREE_ADD_USER
=
PREFIX
+
MQTopicProducer
.
WX_AGREE_ADD_USER
;
/**
* 微信群微信ID和微信用户ID绑定
*/
public
static
final
String
CONSUMER_WXGROUP_USER_BIND
=
PREFIX
+
MQTopicProducer
.
WXGROUP_USER_BIND
;
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/ReaderCenterBindInfoListener.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
mq
.
topic
;
/**
* @author 杨涛
* @description 绑定
* @date 2019/8/23 18:48
*/
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.readercenter.wechat.entity.WechatGroupUser
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
@RabbitListener
(
queues
=
MQTopicConumer
.
CONSUMER_WXGROUP_USER_BIND
)
public
class
ReaderCenterBindInfoListener
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ReaderCenterBindInfoListener
.
class
);
@Autowired
private
WeixinClockBiz
weixinClockBiz
;
@RabbitHandler
@ParamLog
(
"接收到微信用户绑定TOPIC"
)
public
void
process
(
WechatGroupUser
wechatGroupUser
)
{
try
{
if
(
null
!=
wechatGroupUser
&&
null
!=
wechatGroupUser
.
getWechatUserId
()
&&
!
StringUtil
.
isEmpty
(
wechatGroupUser
.
getWxUserId
()))
{
weixinClockBiz
.
receiveWxGroupUserBindTopic
(
wechatGroupUser
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"接收到微信用户绑定TOPIC,JMS异常+++++"
+
e
.
getMessage
(),
e
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WxGroupSendTextListener.java
View file @
3d73fa9d
...
...
@@ -7,13 +7,13 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.book.riddle.biz.RiddleRecordBiz
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.message.dto.SendTextDTO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
...
...
@@ -43,6 +43,8 @@ public class WxGroupSendTextListener {
private
BookClockCheck
bookClockCheck
;
@Autowired
private
RiddleRecordBiz
riddleRecordBiz
;
@Autowired
private
WeixinClockBiz
weixinClockBiz
;
/**
* 接收微信用户进群消息
...
...
@@ -57,10 +59,10 @@ public class WxGroupSendTextListener {
//校验是否机器人账号
List
<
String
>
allRobotWxIds
=
wechatGroupConsr
.
listAllRobotWxId
();
if
(!
ListUtils
.
isEmpty
(
allRobotWxIds
)
&&
!
allRobotWxIds
.
contains
(
wechatUserId
)
&&
!
StringUtil
.
isEmpty
(
sendTextDTO
.
getTextContent
()))
{
Boo
kClockInfoDTO
bookClockInfoDTO
=
bookClockCheck
.
checkKeywordIsClock
(
sendTextDTO
.
getTextContent
().
trim
(),
sendTextDTO
.
getWechatGroupId
());
if
(
null
!=
bookClockInfoDTO
&&
SendMessageTypeEnum
.
GROUP
.
getCode
().
equals
(
sendTextDTO
.
getCode
())){
bookClockKeywordBiz
.
sendKeywordMessage
(
bookClockInfoDTO
,
wechatUserId
,
sendTextDTO
.
getWechatGroupId
(),
sendTextDTO
.
getWxId
(),
sendTextDTO
.
getIp
());
}
else
{
Boo
lean
flag
=
weixinClockBiz
.
checkWeixinClockKeyword
(
sendTextDTO
.
getTextContent
().
trim
(),
sendTextDTO
.
getWechatGroupId
());
if
(
flag
&&
SendMessageTypeEnum
.
GROUP
.
getCode
().
equals
(
sendTextDTO
.
getCode
())){
weixinClockBiz
.
sendKeywordMessage
(
sendTextDTO
.
getTextContent
().
trim
(),
wechatUserId
,
sendTextDTO
.
getWechatGroupId
(),
sendTextDTO
.
getWxId
(),
sendTextDTO
.
getIp
());
}
else
{
final
long
l
=
System
.
currentTimeMillis
();
bookKeywordBiz
.
sendKeywordMessage
(
sendTextDTO
.
getTextContent
().
trim
(),
sendTextDTO
.
getWechatGroupId
(),
wechatUserId
,
sendTextDTO
.
getWxId
(),
sendTextDTO
.
getIp
(),
sendTextDTO
.
getCode
());
log
.
info
(
"[接收用户发送文本消息] 总耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
3d73fa9d
...
...
@@ -289,9 +289,17 @@ public class PushBizImpl implements PushBiz {
pushGroupRecord
.
setPushStatus
(
pushRecord
.
getPushStatus
());
pushGroupRecords
.
add
(
pushGroupRecord
);
pushGroupRecordDao
.
insert
(
pushGroupRecord
);
//获取群信息
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
pushGroup
.
getBookGroupQrcodeId
());
if
(
groupQrcode
==
null
)
{
LOGGER
.
error
(
"未找到群信息!qrcodeId="
+
pushGroup
.
getBookGroupQrcodeId
());
continue
;
}
//获取机器人微信号
String
altId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
groupQrcode
.
getWeixinGroupId
());
//遍历发送消息
for
(
PushItem
pushItem
:
pushItemList
)
{
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
());
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
()
,
altId
);
}
}
}
...
...
@@ -300,7 +308,7 @@ public class PushBizImpl implements PushBiz {
* 发消息
*/
@ParamLog
(
"发消息"
)
private
void
sendWechatMessage
(
PushGroup
pushGroup
,
PushItem
pushItem
,
Long
pushGroupRecordId
)
{
private
void
sendWechatMessage
(
PushGroup
pushGroup
,
PushItem
pushItem
,
Long
pushGroupRecordId
,
String
altId
)
{
//获取群信息
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
pushGroup
.
getBookGroupQrcodeId
());
if
(
groupQrcode
==
null
)
{
...
...
@@ -314,8 +322,6 @@ public class PushBizImpl implements PushBiz {
return
;
}
String
otherUrl
=
"book_group_id="
+
classifyDTO
.
getBookGroupId
()
+
"&classify_id="
+
classifyDTO
.
getId
()
+
"&qrcode_id="
+
pushGroup
.
getBookGroupQrcodeId
();
//获取机器人微信号
String
altId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
groupId
);
if
(
groupQrcode
!=
null
&&
!
StringUtil
.
isEmpty
(
groupId
)
&&
!
StringUtil
.
isEmpty
(
altId
))
{
Integer
itemType
=
pushItem
.
getItemType
();
if
(
ItemTypeEnum
.
TEXT
.
value
.
equals
(
itemType
))
{
...
...
@@ -356,6 +362,7 @@ public class PushBizImpl implements PushBiz {
AppDto
appDto
=
appConsr
.
getBaseById
(
pushItem
.
getAppId
());
if
(
appDto
!=
null
)
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
SendArticleMessageVO
sendArticleMessageVO
=
new
SendArticleMessageVO
();
sendArticleMessageVO
.
setAltId
(
altId
);
sendArticleMessageVO
.
setDescription
(
appDto
.
getTypeName
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
biz
;
import
com.pcloud.book.group.vo.BookGroupClassifyVO
;
import
com.pcloud.book.group.vo.ListGroupClassifyParam
;
import
com.pcloud.book.weixinclock.dto.RankDto
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.readercenter.wechat.entity.WechatGroupUser
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/14 19:11
*/
public
interface
WeixinClockBiz
{
/**
* 创建微信群签到打卡
* @param weixinClockDto
*/
Long
createWeixinClock
(
WeixinClockDto
weixinClockDto
)
throws
BizException
;
/**
* 获取编辑所有的分类
* @param listGroupClassifyParam
*/
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassify4Clock
(
ListGroupClassifyParam
listGroupClassifyParam
,
Long
adviserId
)
throws
BizException
;
/**
* 删除微信群签到打卡
* @param weixinClockId
*/
void
deleteWeixinClock
(
Long
weixinClockId
,
Long
adviserId
)
throws
BizException
;
/**
* 修改微信群签到打卡
* @param weixinClockDto
*/
void
updateWeixinClock
(
WeixinClockDto
weixinClockDto
)
throws
BizException
;
/**
* 微信群签到打卡列表(编辑端)
* @param pageParam
*/
PageBeanNew
<
WeixinClockDto
>
listWeixinClock4Adviser
(
PageParam
pageParam
,
Map
<
String
,
Object
>
paramMap
)
throws
BizException
;
/**
* 获取微信群签到打卡信息
* @param weixinClockId
*/
WeixinClockDto
getWeixinClockBaseInfo
(
Long
weixinClockId
)
throws
BizException
;
/**
* 获取某个微信群签到打卡的所有群分类详情
* @param weixinClockId
*/
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassifyDetail4Clock
(
Long
weixinClockId
,
Integer
currentPage
,
Integer
numPerPage
)
throws
BizException
;
/**
* 校验是否为该群的打卡关键字
* @param weixinGroupId
*/
Boolean
checkWeixinClockKeyword
(
String
content
,
String
weixinGroupId
)
throws
BizException
;
/**
* 发送关键词信息
* @param content
* @param userWxId
* @return
*/
Boolean
sendKeywordMessage
(
String
content
,
String
userWxId
,
String
wechatGroupId
,
String
wxId
,
String
ip
);
/**
* 获取某个群内的打卡排行榜
* @param wxGroupId
* @return
*/
PageBeanNew
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @return
*/
RankDto
getClockWechatUserRank
(
Long
wechatUserId
,
String
wxGroupId
,
String
wxUserId
);
/**
* 接收到微信用户绑定TOPIC
* @param wechatGroupUser
*/
void
receiveWxGroupUserBindTopic
(
WechatGroupUser
wechatGroupUser
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
biz
.
impl
;
import
com.google.common.collect.Lists
;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.clock.dto.PushBookClockKeywordDTO
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.vo.BookGroupClassifyVO
;
import
com.pcloud.book.group.vo.ListGroupClassifyParam
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.book.weixinclock.check.WeixinClockCheck
;
import
com.pcloud.book.weixinclock.dao.WeixinClockDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockMemberDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockPrizeRecordDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockRewardDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockTopicDao
;
import
com.pcloud.book.weixinclock.dto.DrawRewardDto
;
import
com.pcloud.book.weixinclock.dto.RankDto
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClock
;
import
com.pcloud.book.weixinclock.entity.WeixinClockGroupClassify
;
import
com.pcloud.book.weixinclock.entity.WeixinClockMember
;
import
com.pcloud.book.weixinclock.entity.WeixinClockPrizeRecord
;
import
com.pcloud.book.weixinclock.entity.WeixinClockTopic
;
import
com.pcloud.channelcenter.base.constants.ChannelConstants
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
com.pcloud.common.core.constant.ProductTypeConstant
;
import
com.pcloud.common.core.constant.WXKeywordOperationConstant
;
import
com.pcloud.common.core.dto.PromotionGiftDto
;
import
com.pcloud.common.core.dto.PromotionOrderDto
;
import
com.pcloud.common.core.enums.PromotionOrderEnum
;
import
com.pcloud.common.enums.AppTypeEnum
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateNewUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.readercenter.wechat.entity.WechatGroupUser
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/14 19:12
*/
@Component
(
"weixinClockBiz"
)
public
class
WeixinClockBizImpl
implements
WeixinClockBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
WeixinClockBizImpl
.
class
);
@Autowired
private
WeixinClockDao
weixinClockDao
;
@Autowired
private
BookGroupClassifyDao
bookGroupClassifyDao
;
@Autowired
private
WechatGroupConsr
wechatGroupConsr
;
@Autowired
private
LabelService
labelService
;
@Autowired
private
WeixinClockRewardDao
weixinClockRewardDao
;
@Autowired
private
WeixinClockGroupClassifyDao
weixinClockGroupClassifyDao
;
@Autowired
private
AppConsr
appConsr
;
@Autowired
private
WeixinClockMemberDao
weixinClockMemberDao
;
@Autowired
private
WeixinClockTopicDao
weixinClockTopicDao
;
@Autowired
private
BookGroupClassifyBiz
bookGroupClassifyBiz
;
@Autowired
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
private
AmqpTemplate
amqpTemplate
;
@Autowired
private
ReaderConsr
readerConsr
;
@Autowired
private
WeixinClockCheck
weixinClockCheck
;
@Autowired
private
WeixinClockPrizeRecordDao
weixinClockPrizeRecordDao
;
@Autowired
private
AdviserConsr
adviserConsr
;
private
static
final
ThreadFactory
NAMED_THREAD_FACTORY
=
new
ThreadFactoryBuilder
()
.
setNameFormat
(
"weixinclock-pool-%d"
).
build
();
private
static
final
ExecutorService
EXECUTOR_SERVICE
=
new
ThreadPoolExecutor
(
5
,
10
,
0L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<>(
1024
),
NAMED_THREAD_FACTORY
,
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatGroupLinkPrefix
;
/**
* 关创建微信群签到打卡
* @param weixinClockDto
*/
@Override
@ParamLog
(
"创建微信群签到打卡"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createWeixinClock
(
WeixinClockDto
weixinClockDto
)
throws
BizException
{
if
(
null
==
weixinClockDto
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少必要参数!"
);
}
weixinClockCheck
.
checkParam4CreateWeixinClock
(
weixinClockDto
);
WeixinClock
weixinClock
=
new
WeixinClock
();
BeanUtils
.
copyProperties
(
weixinClockDto
,
weixinClock
);
weixinClockDao
.
insert
(
weixinClock
);
Long
weixinClockId
=
weixinClock
.
getWeixinClockId
();
if
(!
ListUtils
.
isEmpty
(
weixinClockDto
.
getGroupClassifyIds
()))
{
List
<
WeixinClockGroupClassify
>
groupClassifyIds
=
Lists
.
newArrayList
();
weixinClockDto
.
getGroupClassifyIds
().
forEach
(
e
->
{
WeixinClockGroupClassify
weixinClockGroupClassify
=
new
WeixinClockGroupClassify
();
weixinClockGroupClassify
.
setBookGroupClassifyId
(
e
);
weixinClockGroupClassify
.
setWeixinClockId
(
weixinClockId
);
groupClassifyIds
.
add
(
weixinClockGroupClassify
);
});
weixinClockGroupClassifyDao
.
batchInsert
(
groupClassifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
weixinClockDto
.
getWeixinClockRewards
()))
{
weixinClockDto
.
getWeixinClockRewards
().
forEach
(
e
->
e
.
setWeixinClockId
(
weixinClockId
));
weixinClockRewardDao
.
batchInsert
(
weixinClockDto
.
getWeixinClockRewards
());
}
return
weixinClockId
;
}
@Override
@ParamLog
(
"获取编辑所有的分类"
)
public
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassify4Clock
(
ListGroupClassifyParam
listGroupClassifyParam
,
Long
adviserId
)
throws
BizException
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adviserId"
,
adviserId
);
if
(!
StringUtil
.
isEmpty
(
listGroupClassifyParam
.
getName
()))
{
paramMap
.
put
(
"name"
,
listGroupClassifyParam
.
getName
());
}
paramMap
.
put
(
"bookIds"
,
listGroupClassifyParam
.
getBookIds
());
paramMap
.
put
(
"proLabelId"
,
listGroupClassifyParam
.
getProLabelId
());
paramMap
.
put
(
"depLabelId"
,
listGroupClassifyParam
.
getDepLabelId
());
paramMap
.
put
(
"purLabelId"
,
listGroupClassifyParam
.
getPurLabelId
());
PageParam
pageParam
=
new
PageParam
(
listGroupClassifyParam
.
getCurrentPage
(),
listGroupClassifyParam
.
getNumPerPage
());
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
bookGroupClassifyDao
.
listPageNew
(
pageParam
,
paramMap
,
"listGroupClassify4Clock"
);
if
(
pageBeanNew
==
null
)
{
return
new
PageBeanNew
<>(
listGroupClassifyParam
.
getCurrentPage
(),
listGroupClassifyParam
.
getNumPerPage
(),
new
ArrayList
<>());
}
//遍历填充标签
List
<
BookGroupClassifyVO
>
bookGroupClassifyVOS
=
pageBeanNew
.
getRecordList
();
if
(!
ListUtils
.
isEmpty
(
bookGroupClassifyVOS
))
{
List
<
Long
>
labelIds
=
new
ArrayList
<>();
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
for
(
BookGroupClassifyVO
bookGroupClassifyVO
:
bookGroupClassifyVOS
)
{
classifyIds
.
add
(
bookGroupClassifyVO
.
getClassifyId
());
if
(
bookGroupClassifyVO
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getProLabelId
());
}
if
(
bookGroupClassifyVO
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getPurLabelId
());
}
if
(
bookGroupClassifyVO
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getDepLabelId
());
}
}
Map
<
Long
,
Integer
>
activeCountMap
=
wechatGroupConsr
.
get7DayActiveUserCountByClassify
(
classifyIds
);
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
}
for
(
BookGroupClassifyVO
bookGroupClassifyVO
:
bookGroupClassifyVOS
)
{
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
Long
proLabelId
=
bookGroupClassifyVO
.
getProLabelId
();
Long
purLabelId
=
bookGroupClassifyVO
.
getPurLabelId
();
Long
depLabelId
=
bookGroupClassifyVO
.
getDepLabelId
();
if
(
proLabelId
!=
null
)
{
bookGroupClassifyVO
.
setProLabelName
(
labelMap
.
get
(
proLabelId
));
}
if
(
purLabelId
!=
null
)
{
bookGroupClassifyVO
.
setPurLabelName
(
labelMap
.
get
(
purLabelId
));
}
if
(
depLabelId
!=
null
)
{
bookGroupClassifyVO
.
setDepLabelName
(
labelMap
.
get
(
depLabelId
));
}
}
Integer
count
=
activeCountMap
.
get
(
bookGroupClassifyVO
.
getClassifyId
());
if
(
count
==
null
)
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
0
);
}
else
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
count
);
}
}
}
return
pageBeanNew
;
}
/**
* 删除微信群签到打卡
* @param weixinClockId
* @param adviserId
*/
@Override
@ParamLog
(
"删除微信群签到打卡"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteWeixinClock
(
Long
weixinClockId
,
Long
adviserId
)
throws
BizException
{
if
(
null
==
weixinClockId
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少删除的必要参数"
);
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"weixinClockId"
,
weixinClockId
);
//删除对应的群分类
weixinClockGroupClassifyDao
.
deleteById
(
weixinClockId
);
//删除对应的奖励信息
weixinClockRewardDao
.
deleteById
(
weixinClockId
);
//删除主表的微信群签到打卡
weixinClockDao
.
deleteWeixinClock
(
paramMap
);
}
/**
* 修改微信群签到打卡
* @param weixinClockDto
* @throws BizException
*/
@Override
@ParamLog
(
"修改微信群签到打卡"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateWeixinClock
(
WeixinClockDto
weixinClockDto
)
throws
BizException
{
if
(
null
==
weixinClockDto
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少必要参数!"
);
}
if
(
null
==
weixinClockDto
.
getWeixinClockId
()){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少修改的必要参数"
);
}
weixinClockCheck
.
checkParam4CreateWeixinClock
(
weixinClockDto
);
Long
weixinClockId
=
weixinClockDto
.
getWeixinClockId
();
WeixinClock
weixinClock
=
new
WeixinClock
();
BeanUtils
.
copyProperties
(
weixinClockDto
,
weixinClock
);
weixinClockDao
.
update
(
weixinClock
);
//删除对应的群分类
weixinClockGroupClassifyDao
.
deleteById
(
weixinClockId
);
//删除对应的基本信息
weixinClockRewardDao
.
deleteById
(
weixinClockId
);
if
(!
ListUtils
.
isEmpty
(
weixinClockDto
.
getGroupClassifyIds
()))
{
List
<
WeixinClockGroupClassify
>
groupClassifyIds
=
Lists
.
newArrayList
();
weixinClockDto
.
getGroupClassifyIds
().
forEach
(
e
->
{
WeixinClockGroupClassify
weixinClockGroupClassify
=
new
WeixinClockGroupClassify
();
weixinClockGroupClassify
.
setBookGroupClassifyId
(
e
);
weixinClockGroupClassify
.
setWeixinClockId
(
weixinClockId
);
groupClassifyIds
.
add
(
weixinClockGroupClassify
);
});
weixinClockGroupClassifyDao
.
batchInsert
(
groupClassifyIds
);
}
if
(!
ListUtils
.
isEmpty
(
weixinClockDto
.
getWeixinClockRewards
()))
{
weixinClockDto
.
getWeixinClockRewards
().
forEach
(
e
->
e
.
setWeixinClockId
(
weixinClockId
));
weixinClockRewardDao
.
batchInsert
(
weixinClockDto
.
getWeixinClockRewards
());
}
}
@Override
public
PageBeanNew
<
WeixinClockDto
>
listWeixinClock4Adviser
(
PageParam
pageParam
,
Map
<
String
,
Object
>
paramMap
)
throws
BizException
{
PageBeanNew
<
WeixinClockDto
>
clockDtoPage
=
weixinClockDao
.
listPageNew
(
pageParam
,
paramMap
,
"listWeixinClock4Adviser"
);
if
(
clockDtoPage
==
null
)
{
return
new
PageBeanNew
<>(
pageParam
.
getPageNum
(),
pageParam
.
getNumPerPage
(),
0
,
new
ArrayList
<>());
}
List
<
Long
>
appIds
=
clockDtoPage
.
getRecordList
().
stream
().
map
(
WeixinClockDto:
:
getClockPrizeId
).
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
appIds
))
{
Map
<
Long
,
AppDto
>
resultsMap
=
appConsr
.
getBaseByIds
(
appIds
);
for
(
WeixinClockDto
weixinClockDto:
clockDtoPage
.
getRecordList
()){
if
(
null
!=
resultsMap
&&
resultsMap
.
containsKey
(
weixinClockDto
.
getClockPrizeId
())){
AppDto
appDto
=
resultsMap
.
get
(
weixinClockDto
.
getClockPrizeId
());
DrawRewardDto
drawRewardDto
=
new
DrawRewardDto
();
drawRewardDto
.
setAppId
(
weixinClockDto
.
getClockPrizeId
());
drawRewardDto
.
setChannelId
(
appDto
.
getChannelId
());
drawRewardDto
.
setSquareImg
(
appDto
.
getSquareImg
());
drawRewardDto
.
setTitle
(
appDto
.
getTitle
());
drawRewardDto
.
setTypeCode
(
appDto
.
getTypeCode
());
weixinClockDto
.
setDrawRewardDto
(
drawRewardDto
);
}
}
}
return
clockDtoPage
==
null
?
new
PageBeanNew
()
:
clockDtoPage
;
}
@Override
public
WeixinClockDto
getWeixinClockBaseInfo
(
Long
weixinClockId
)
throws
BizException
{
WeixinClockDto
weixinClockDto
=
weixinClockDao
.
getWeixinClockBaseInfo
(
weixinClockId
);
if
(
null
!=
weixinClockDto
&&
null
!=
weixinClockDto
.
getClockPrizeId
()
&&
!
weixinClockDto
.
getClockPrizeId
().
equals
(
0L
))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
weixinClockDto
.
getClockPrizeId
());
DrawRewardDto
drawRewardDto
=
new
DrawRewardDto
();
drawRewardDto
.
setAppId
(
weixinClockDto
.
getClockPrizeId
());
drawRewardDto
.
setChannelId
(
appDto
.
getChannelId
());
drawRewardDto
.
setSquareImg
(
appDto
.
getSquareImg
());
drawRewardDto
.
setTitle
(
appDto
.
getTitle
());
drawRewardDto
.
setTypeCode
(
appDto
.
getTypeCode
());
weixinClockDto
.
setDrawRewardDto
(
drawRewardDto
);
}
return
weixinClockDto
==
null
?
new
WeixinClockDto
()
:
weixinClockDto
;
}
@Override
@ParamLog
(
"获取某个微信群签到打卡的所有群分类详情"
)
public
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassifyDetail4Clock
(
Long
weixinClockId
,
Integer
currentPage
,
Integer
numPerPage
)
throws
BizException
{
if
(
null
==
weixinClockId
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少微信打卡标识的必要参数!"
);
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"weixinClockId"
,
weixinClockId
);
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
weixinClockDao
.
listPageNew
(
pageParam
,
paramMap
,
"listGroupClassifyDetail4Clock"
);
if
(
pageBeanNew
==
null
)
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
List
<
BookGroupClassifyVO
>
bookGroupClassifyVOS
=
pageBeanNew
.
getRecordList
();
if
(!
ListUtils
.
isEmpty
(
bookGroupClassifyVOS
))
{
List
<
Long
>
classifyIds
=
bookGroupClassifyVOS
.
stream
().
map
(
BookGroupClassifyVO:
:
getClassifyId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
Integer
>
activeCountMap
=
wechatGroupConsr
.
get7DayActiveUserCountByClassify
(
classifyIds
);
for
(
BookGroupClassifyVO
bookGroupClassifyVO
:
bookGroupClassifyVOS
)
{
//最近7天活跃人数
Integer
count
=
activeCountMap
.
get
(
bookGroupClassifyVO
.
getClassifyId
());
if
(
count
==
null
)
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
0
);
}
else
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
count
);
}
}
}
return
pageBeanNew
==
null
?
new
PageBeanNew
()
:
pageBeanNew
;
}
@Override
@ParamLog
(
"校验是否为该群的打卡关键字"
)
public
Boolean
checkWeixinClockKeyword
(
String
content
,
String
weixinGroupId
)
throws
BizException
{
LOGGER
.
info
(
"content----->"
+
content
+
"weixinGroupId----->"
+
weixinGroupId
);
//简单过滤非关键词的词
if
(
StringUtil
.
isEmpty
(
content
)
||
content
.
length
()
>
10
)
{
return
false
;
}
//通过群id获取对应基本信息
GroupClassifyQrcodeDTO
classifyQrcodeInfo
=
bookGroupClassifyBiz
.
getClassifyQrcodeInfo
(
weixinGroupId
);
if
(
null
==
classifyQrcodeInfo
){
return
false
;
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookGroupClassifyId"
,
classifyQrcodeInfo
.
getClassifyId
());
String
aimKeyword
=
weixinClockGroupClassifyDao
.
getKeywordByGroupClassify
(
paramMap
);
LOGGER
.
info
(
"aimKeyword="
+
aimKeyword
+
"content="
+
content
);
return
content
.
equalsIgnoreCase
(
aimKeyword
);
}
private
String
getClockRankUrl
(
Long
adviserId
,
Long
clockPrizeId
,
String
wxGroupId
,
String
wxUserId
){
StringBuffer
sbu
=
new
StringBuffer
();
if
(
null
!=
clockPrizeId
&&
!
clockPrizeId
.
equals
(
0L
))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
clockPrizeId
);
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
if
(
null
==
accountSettingDto
)
{
return
""
;
}
String
protocol
=
accountSettingDto
.
getProtocol
();
if
(
StringUtils
.
isEmpty
(
protocol
))
{
protocol
=
ChannelConstants
.
HTTP
;
}
sbu
.
append
(
protocol
).
append
(
accountSettingDto
.
getDomain
()).
append
(
"/W"
)
.
append
(
accountSettingDto
.
getAccountSettingId
()).
append
(
"/clock"
).
append
(
"?wxGroupId="
)
.
append
(
wxGroupId
).
append
(
"&wxUserId="
).
append
(
wxUserId
);
return
UrlUtils
.
getShortUrl4Own
(
sbu
.
toString
());
}
if
(
null
!=
adviserId
&&
!
adviserId
.
equals
(
0L
)){
Long
channelId
=
adviserConsr
.
getDefaultChannel
(
adviserId
);
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
if
(
null
==
accountSettingDto
)
{
return
""
;
}
String
protocol
=
accountSettingDto
.
getProtocol
();
if
(
StringUtils
.
isEmpty
(
protocol
))
{
protocol
=
ChannelConstants
.
HTTP
;
}
sbu
.
append
(
protocol
).
append
(
accountSettingDto
.
getDomain
()).
append
(
"/W"
)
.
append
(
accountSettingDto
.
getAccountSettingId
()).
append
(
"/clock"
).
append
(
"?wxGroupId="
)
.
append
(
wxGroupId
).
append
(
"&wxUserId="
).
append
(
wxUserId
);
return
UrlUtils
.
getShortUrl4Own
(
sbu
.
toString
());
}
return
""
;
}
private
String
getClockRewardUrl
(
Long
clockPrizeId
){
StringBuffer
sbu
=
new
StringBuffer
();
if
(
null
!=
clockPrizeId
&&
!
clockPrizeId
.
equals
(
0L
))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
clockPrizeId
);
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
if
(
null
==
accountSettingDto
){
return
""
;
}
String
protocol
=
accountSettingDto
.
getProtocol
();
if
(
StringUtils
.
isEmpty
(
protocol
))
{
protocol
=
ChannelConstants
.
HTTP
;
}
if
(
accountSettingDto
.
getRandom
()
!=
null
)
{
sbu
.
append
(
protocol
).
append
(
"app"
).
append
(
accountSettingDto
.
getRandom
()).
append
(
"."
).
append
(
accountSettingDto
.
getFirstDomain
())
.
append
(
"/luck"
).
append
(
"/W"
).
append
(
accountSettingDto
.
getAccountSettingId
()).
append
(
"/C"
).
append
(
appDto
.
getChannelId
())
.
append
(
"/A"
).
append
(
appDto
.
getAppId
())
.
append
(
"/luckPage?isPreview=1&adviserId="
).
append
(
appDto
.
getCreatedUser
()).
append
(
"&appType=="
).
append
(
appDto
.
getTypeCode
())
.
append
(
"&origin=wxGroup"
);
}
else
{
sbu
.
append
(
protocol
).
append
(
"app."
).
append
(
accountSettingDto
.
getFirstDomain
())
.
append
(
"/luck"
).
append
(
"/W"
).
append
(
accountSettingDto
.
getAccountSettingId
()).
append
(
"/C"
).
append
(
appDto
.
getChannelId
())
.
append
(
"/A"
).
append
(
appDto
.
getAppId
())
.
append
(
"/luckPage?isPreview=1&adviserId="
).
append
(
appDto
.
getCreatedUser
()).
append
(
"&appType=="
).
append
(
appDto
.
getTypeCode
())
.
append
(
"&origin=wxGroup"
);
}
LOGGER
.
info
(
"抽奖的跳转链接====="
+
sbu
.
toString
()
+
"================s"
);
return
UrlUtils
.
getShortUrl4Own
(
sbu
.
toString
());
}
return
""
;
}
/**
* 发送关键词信息
* @param content
* @param userWxId
* @return
*/
@Override
@ParamLog
(
"为微信群打卡关键词,发送关键词信息"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
sendKeywordMessage
(
String
content
,
String
userWxId
,
String
wechatGroupId
,
String
wxId
,
String
ip
)
{
LOGGER
.
info
(
"接受到的关键词信息"
+
content
);
GroupClassifyQrcodeDTO
classifyQrcodeInfo
=
bookGroupClassifyBiz
.
getClassifyQrcodeInfo
(
wechatGroupId
);
if
(
null
==
classifyQrcodeInfo
){
return
false
;
}
WeixinClockDto
weixinClockDto
=
weixinClockGroupClassifyDao
.
getClockBaseInfoByClassify
(
classifyQrcodeInfo
.
getClassifyId
());
WeixinClockMember
clockMember
=
weixinClockMemberDao
.
getByWxUserId
(
wechatGroupId
,
userWxId
);
AppDto
appDto
=
appConsr
.
getBaseById
(
weixinClockDto
.
getClockPrizeId
());
Long
channelId
=
null
;
if
(
null
==
appDto
)
{
channelId
=
adviserConsr
.
getDefaultChannel
(
weixinClockDto
.
getCreateUser
());
}
else
{
channelId
=
appDto
.
getChannelId
();
}
Long
wechatUserId
=
readerConsr
.
getWechatUserId
(
userWxId
,
channelId
);
GroupUserDTO
groupUserDTO
=
wechatGroupConsr
.
getWxUserInfoByWxUserId
(
userWxId
);
groupUserDTO
=
null
==
groupUserDTO
?
new
GroupUserDTO
()
:
groupUserDTO
;
Long
weixinClockMemberId
=
clockMember
==
null
?
null
:
clockMember
.
getWeixinClockMemberId
();
if
(
null
==
clockMember
)
{
WeixinClockMember
weixinClockMember
=
new
WeixinClockMember
();
weixinClockMember
.
setWeixinClockId
(
weixinClockDto
.
getWeixinClockId
());
weixinClockMember
.
setAllClockDay
(
0
);
weixinClockMember
.
setBookGroupClassifyId
(
classifyQrcodeInfo
.
getClassifyId
());
weixinClockMember
.
setHeadPic
(
groupUserDTO
.
getHeadPic
());
weixinClockMember
.
setNickname
(
groupUserDTO
.
getNickName
());
weixinClockMember
.
setWxGroupId
(
wechatGroupId
);
weixinClockMember
.
setWxUserId
(
userWxId
);
weixinClockMember
.
setWechatUserId
(
wechatUserId
);
weixinClockMemberDao
.
insert
(
weixinClockMember
);
weixinClockMemberId
=
weixinClockMember
.
getWeixinClockMemberId
();
}
SendTextMessageVO
vo
=
new
SendTextMessageVO
();
vo
.
setAltId
(
wxId
);
vo
.
setWxGroupId
(
wechatGroupId
);
vo
.
setIp
(
ip
);
String
sendContent
=
""
;
String
nickname
=
groupUserDTO
.
getNickName
();
if
(
StringUtil
.
isEmpty
(
nickname
)){
nickname
=
"神秘客"
;
}
WeixinClockTopic
weixinTopic
=
weixinClockTopicDao
.
getTopicByIds4Today
(
wechatGroupId
,
userWxId
);
if
(
null
==
weixinTopic
){
WeixinClockTopic
weixinClockTopic
=
new
WeixinClockTopic
();
weixinClockTopic
.
setBookGroupClassifyId
(
classifyQrcodeInfo
.
getClassifyId
());
weixinClockTopic
.
setCreatedDay
(
new
Date
());
weixinClockTopic
.
setWeixinClockId
(
weixinClockDto
.
getWeixinClockId
());
weixinClockTopic
.
setWxGroupId
(
wechatGroupId
);
weixinClockTopic
.
setWxUserId
(
userWxId
);
weixinClockTopic
.
setWeixinClockMemberId
(
weixinClockMemberId
);
weixinClockMemberDao
.
updateClockDays
(
wechatGroupId
,
userWxId
,
wechatUserId
);
weixinClockTopicDao
.
insert
(
weixinClockTopic
);
//发topic,增加抽奖次数
//发送抽奖的TOPIC
Long
clockDays
=
weixinClockTopicDao
.
getClockCountByUser
(
wechatGroupId
,
userWxId
);
if
(
null
!=
weixinClockDto
.
getClockPrizeId
())
{
if
(
null
!=
wechatUserId
&&
!
wechatUserId
.
equals
(
0L
))
{
EXECUTOR_SERVICE
.
execute
(()
->
{
LOGGER
.
info
(
"异步校验是否满足抽奖要求,clockDays="
+
clockDays
);
PromotionOrderDto
promotionOrderDto
=
new
PromotionOrderDto
();
List
<
PromotionGiftDto
>
promotionGiftDtoList
=
new
ArrayList
<>();
PromotionGiftDto
promotionGiftDto
=
new
PromotionGiftDto
();
promotionGiftDto
.
setTargetClass
(
PromotionOrderEnum
.
TARGET_CLASS_APP
.
getCode
());
promotionGiftDto
.
setTargetType
(
AppTypeEnum
.
DRAW
.
value
);
promotionGiftDto
.
setTargetId
(
weixinClockDto
.
getClockPrizeId
());
Integer
grantNum
=
weixinClockRewardDao
.
getGrantNumFromReward
(
weixinClockDto
.
getWeixinClockId
(),
clockDays
);
promotionGiftDto
.
setGrantNum
(
grantNum
==
null
?
"0"
:
grantNum
.
toString
());
promotionGiftDtoList
.
add
(
promotionGiftDto
);
promotionOrderDto
.
setGifts
(
promotionGiftDtoList
);
promotionOrderDto
.
setUserId
(
wechatUserId
);
LOGGER
.
info
(
"发送抽奖规则,参数:promotionOrderDto="
+
promotionOrderDto
);
amqpTemplate
.
convertAndSend
(
MQTopicProducer
.
EXCHAGE
,
MQTopicProducer
.
GIVE_GIFT
,
promotionOrderDto
);
});
}
else
{
WeixinClockPrizeRecord
weixinClockPrizeRecord1
=
weixinClockPrizeRecordDao
.
selectByWxUserIdAndAppId
(
userWxId
,
weixinClockDto
.
getClockPrizeId
());
LOGGER
.
info
(
"weixinClockPrizeRecord1====="
+
weixinClockPrizeRecord1
);
if
(
null
==
weixinClockPrizeRecord1
)
{
WeixinClockPrizeRecord
weixinClockPrizeRecord2
=
new
WeixinClockPrizeRecord
();
weixinClockPrizeRecord2
.
setClockPrizeId
(
weixinClockDto
.
getClockPrizeId
());
weixinClockPrizeRecord2
.
setWxUserId
(
userWxId
);
Integer
grantNum
=
weixinClockRewardDao
.
getGrantNumFromReward
(
weixinClockDto
.
getWeixinClockId
(),
clockDays
);
weixinClockPrizeRecord2
.
setPrizeTime
(
grantNum
==
null
?
0
:
grantNum
);
LOGGER
.
info
(
"weixinClockPrizeRecord2------"
+
weixinClockPrizeRecord2
);
weixinClockPrizeRecordDao
.
insert
(
weixinClockPrizeRecord2
);
}
else
{
Integer
grantNum
=
weixinClockRewardDao
.
getGrantNumFromReward
(
weixinClockDto
.
getWeixinClockId
(),
clockDays
);
grantNum
=
grantNum
==
null
?
0
:
grantNum
;
weixinClockPrizeRecordDao
.
updatePrizeTime
(
userWxId
,
weixinClockDto
.
getClockPrizeId
(),
grantNum
);
}
}
}
//获取我的新排名
Integer
newOrder
=
weixinClockMemberDao
.
getMyNewOrder
(
wechatGroupId
,
userWxId
);
String
clockRewardUrl
=
getClockRewardUrl
(
weixinClockDto
.
getClockPrizeId
());
String
clockRankUrl
=
getClockRankUrl
(
weixinClockDto
.
getCreateUser
(),
weixinClockDto
.
getClockPrizeId
(),
wechatGroupId
,
userWxId
);
Calendar
today
=
Calendar
.
getInstance
();
int
month
=
today
.
get
(
Calendar
.
MONTH
)
+
1
;
int
dayOfMonth
=
today
.
get
(
Calendar
.
DAY_OF_MONTH
);
Integer
grantNum
=
weixinClockRewardDao
.
getGrantNumFromReward
(
weixinClockDto
.
getWeixinClockId
(),
clockDays
);
if
(
null
==
weixinClockDto
.
getClockPrizeId
()){
grantNum
=
0
;
}
if
(
null
!=
grantNum
&&
!
grantNum
.
equals
(
0
)){
sendContent
=
"@"
+
nickname
+
" "
+
weixinClockDto
.
getClockIntroduction
()
+
"\n"
+
month
+
"月"
+
dayOfMonth
+
"日打卡成功,你已累积打卡"
+
clockDays
+
"天,排名第"
+
newOrder
+
",明天继续!"
+
"\n"
+
"\n"
+
"查看排行榜:"
+
clockRankUrl
+
"\n"
+
"点击抽奖,即可有机会获得精美礼品哦:"
+
clockRewardUrl
;
}
else
{
sendContent
=
"@"
+
nickname
+
" "
+
weixinClockDto
.
getClockIntroduction
()
+
"\n"
+
month
+
"月"
+
dayOfMonth
+
"日打卡成功,你已累积打卡"
+
clockDays
+
"天,排名第"
+
newOrder
+
",明天继续!"
+
"\n"
+
"\n"
+
"查看排行榜:"
+
clockRankUrl
;
}
}
else
{
sendContent
=
"@"
+
nickname
+
" ,你今天已经打过卡了,明天再继续!"
;
}
vo
.
setContent
(
sendContent
);
LOGGER
.
info
(
"微信群内加入并打卡:发送微信消息vo="
+
vo
);
WxGroupSDK
.
sendTextMessage
(
vo
);
return
true
;
}
/**
* 获取某个群内的打卡排行榜
* @param wxGroupId
* @param wxUserId
* @return
*/
@Override
@ParamLog
(
"获取某个群内的打卡排行榜"
)
public
PageBeanNew
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxGroupId"
,
wxGroupId
);
map
.
put
(
"wxUserId"
,
wxUserId
);
PageBeanNew
<
RankDto
>
rankDtos
=
weixinClockMemberDao
.
listPageNew
(
pageParam
,
map
,
"listWeixinClockRank"
);
if
(
null
==
rankDtos
||
ListUtils
.
isEmpty
(
rankDtos
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
return
rankDtos
;
}
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @param wxUserId
* @return
*/
@Override
@ParamLog
(
"获取某个群内某个用户的信息"
)
public
RankDto
getClockWechatUserRank
(
Long
wechatUserId
,
String
wxGroupId
,
String
wxUserId
)
{
RankDto
rankDto
=
weixinClockMemberDao
.
getClockWechatUserRank
(
wechatUserId
,
wxGroupId
);
return
null
==
rankDto
?
new
RankDto
()
:
rankDto
;
}
/**
* 接收到微信用户绑定TOPIC
* @param wechatGroupUser
*/
@Override
@ParamLog
(
"微信用户绑定"
)
public
void
receiveWxGroupUserBindTopic
(
WechatGroupUser
wechatGroupUser
)
{
List
<
WeixinClockPrizeRecord
>
weixinClockPrizeRecords
=
weixinClockPrizeRecordDao
.
getAllPrizeList
(
wechatGroupUser
.
getWxUserId
());
PromotionOrderDto
promotionOrderDto
=
new
PromotionOrderDto
();
List
<
PromotionGiftDto
>
promotionGiftDtoList
=
new
ArrayList
<>();
for
(
WeixinClockPrizeRecord
weixinClockPrizeRecord
:
weixinClockPrizeRecords
){
PromotionGiftDto
promotionGiftDto
=
new
PromotionGiftDto
();
promotionGiftDto
.
setTargetClass
(
PromotionOrderEnum
.
TARGET_CLASS_APP
.
getCode
());
promotionGiftDto
.
setTargetType
(
AppTypeEnum
.
DRAW
.
value
);
promotionGiftDto
.
setTargetId
(
weixinClockPrizeRecord
.
getClockPrizeId
());
Integer
grantNum
=
weixinClockPrizeRecord
.
getPrizeTime
();
promotionGiftDto
.
setGrantNum
(
grantNum
==
null
?
"0"
:
grantNum
.
toString
());
promotionGiftDtoList
.
add
(
promotionGiftDto
);
}
promotionOrderDto
.
setGifts
(
promotionGiftDtoList
);
promotionOrderDto
.
setUserId
(
wechatGroupUser
.
getWechatUserId
());
LOGGER
.
info
(
"发送抽奖规则,参数:promotionOrderDto="
+
promotionOrderDto
);
amqpTemplate
.
convertAndSend
(
MQTopicProducer
.
EXCHAGE
,
MQTopicProducer
.
GIVE_GIFT
,
promotionOrderDto
);
weixinClockPrizeRecordDao
.
deleteByWxUserId
(
wechatGroupUser
.
getWxUserId
());
weixinClockMemberDao
.
updatMemberWechatUserId
(
wechatGroupUser
.
getWxUserId
(),
wechatGroupUser
.
getWechatUserId
());
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/check/WeixinClockCheck.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
check
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
/**
* @author 杨涛
* @description 检查
* @date 2019/8/20 10:03
*/
public
interface
WeixinClockCheck
{
void
checkParam4CreateWeixinClock
(
WeixinClockDto
weixinClockDto
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/check/impl/WeixinClockCheckImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
check
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.clock.entity.BookClockInfo
;
import
com.pcloud.book.weixinclock.check.WeixinClockCheck
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* @author 杨涛
* @description 检查
* @date 2019/8/20 10:19
*/
@Component
(
"weixinClockCheck"
)
public
class
WeixinClockCheckImpl
implements
WeixinClockCheck
{
/**
* 创建微信签到打卡时的参数校验
* @param weixinClockDto
*/
@Override
public
void
checkParam4CreateWeixinClock
(
WeixinClockDto
weixinClockDto
)
{
if
(
StringUtil
.
isEmpty
(
weixinClockDto
.
getClockKeyword
())){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少打卡关键词!"
);
}
if
(
StringUtil
.
isEmpty
(
weixinClockDto
.
getClockGuide
())){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少打卡引导语!"
);
}
if
(
StringUtil
.
isEmpty
(
weixinClockDto
.
getClockIntroduction
())){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"缺少打卡简介!"
);
}
/*if(null == weixinClockDto.getClockPrizeId()){
throw new BookBizException(BookBizException.ERROR,"缺少打卡的奖励应用ID!");
}*/
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClock
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.Map
;
/**
* @author 杨涛
* @description dao层
* @date 2019/8/14 19:17
*/
public
interface
WeixinClockDao
extends
BaseDao
<
WeixinClock
>
{
/**
* 删除微信群签到打卡
* @param paramMap
*/
void
deleteWeixinClock
(
Map
<
String
,
Object
>
paramMap
);
/**
* 获取微信群签到打卡信息
* @param weixinClockId
*/
WeixinClockDto
getWeixinClockBaseInfo
(
Long
weixinClockId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockGroupClassifyDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.book.weixinclock.dto.ClassifyInfoDto
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClockGroupClassify
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description 群分类
* @date 2019/8/15 11:25
*/
public
interface
WeixinClockGroupClassifyDao
extends
BaseDao
<
WeixinClockGroupClassify
>
{
/**
* 批量插入
* @param groupClassifyIds
*/
void
batchInsert
(
List
<
WeixinClockGroupClassify
>
groupClassifyIds
);
/**
* 获取该群分类下的打卡关键字
* @param paramMap
* @return
*/
String
getKeywordByGroupClassify
(
Map
<
String
,
Object
>
paramMap
);
/**
* 根据群分类获取某个群的详细信息
* @param bookGroupClassifyId
* @return
*/
WeixinClockDto
getClockBaseInfoByClassify
(
Long
bookGroupClassifyId
);
/**
* 根据weixinClockId获取群分类等统计
* @param weixinClockId
* @return
*/
StatisticVO
getClockGroupStatistics
(
Long
weixinClockId
);
/**
* 获取群分类详情
* @param weixinClockId
* @return
*/
List
<
ClassifyInfoDto
>
getClassifyInfo4Update
(
Long
weixinClockId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockMemberDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.weixinclock.dto.RankDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClockMember
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/16 9:59
*/
public
interface
WeixinClockMemberDao
extends
BaseDao
<
WeixinClockMember
>
{
/**
* 获取某个群内的打卡排行榜
* @param wxGroupId
* @return
*/
List
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
);
/**
* 获取某个群内某用户的信息
* @param userWxId
* @return
*/
WeixinClockMember
getByWxUserId
(
String
wechatGroupId
,
String
userWxId
);
/**
* 更新打卡天数
* @param userWxId
* @return
*/
void
updateClockDays
(
String
wechatGroupId
,
String
userWxId
,
Long
wechatUserId
);
/**
* 获取的打卡排名(微信群)
* @param wechatGroupId
* @param userWxId
* @return
*/
Integer
getMyNewOrder
(
String
wechatGroupId
,
String
userWxId
);
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @param wechatUserId
* @return
*/
RankDto
getClockWechatUserRank
(
Long
wechatUserId
,
String
wxGroupId
);
/**
* 同步wechatuserId
* @param wxUserId
* @param wechatUserId
* @return
*/
void
updatMemberWechatUserId
(
String
wxUserId
,
Long
wechatUserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockPrizeRecordDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockPrizeRecord
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
public
interface
WeixinClockPrizeRecordDao
extends
BaseDao
<
WeixinClockPrizeRecord
>
{
int
deleteByWxUserId
(
String
wxUserId
);
WeixinClockPrizeRecord
selectByWxUserIdAndAppId
(
String
wxUserId
,
Long
appId
);
void
updatePrizeTime
(
String
wxUserId
,
Long
clockPrizeId
,
Integer
grantNum
);
List
<
WeixinClockPrizeRecord
>
getAllPrizeList
(
String
wxUserId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockRewardDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockReward
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @author 杨涛
* @description 奖励
* @date 2019/8/15 14:04
*/
public
interface
WeixinClockRewardDao
extends
BaseDao
<
WeixinClockReward
>
{
/**
* 批量插入
* @param weixinClockRewards
*/
void
batchInsert
(
List
<
WeixinClockReward
>
weixinClockRewards
);
/**
* 获取奖励详情给编辑
* @param weixinClockId
*/
List
<
WeixinClockReward
>
listRewardDetail4Adviser
(
Long
weixinClockId
);
/**
* 获取奖励次数
* @param weixinClockId
*/
Integer
getGrantNumFromReward
(
Long
weixinClockId
,
Long
clockDays
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockTopicDao.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockTopic
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/16 11:39
*/
public
interface
WeixinClockTopicDao
extends
BaseDao
<
WeixinClockTopic
>
{
/**
* 获取用户今天打卡情况
* @param wxGroupId
* @param wxUserId
* @return
*/
WeixinClockTopic
getTopicByIds4Today
(
String
wxGroupId
,
String
wxUserId
);
/**
* 获得用户的打卡天数
* @param wxGroupId
* @param wxUserId
* @return
*/
Long
getClockCountByUser
(
String
wxGroupId
,
String
wxUserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.pcloud.book.weixinclock.dao.WeixinClockDao
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClock
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.Map
;
/**
* @author 杨涛
* @description dao层
* @date 2019/8/14 19:18
*/
@Repository
(
"weixinClockDao"
)
public
class
WeixinClockDaoImpl
extends
BaseDaoImpl
<
WeixinClock
>
implements
WeixinClockDao
{
/**
* 删除微信群签到打卡
* @param paramMap
* @return
*/
@Override
public
void
deleteWeixinClock
(
Map
<
String
,
Object
>
paramMap
)
{
super
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteWeixinClock"
),
paramMap
);
}
/**
* 获取微信群签到打卡信息
* @param weixinClockId
* @return
*/
@Override
public
WeixinClockDto
getWeixinClockBaseInfo
(
Long
weixinClockId
)
{
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getWeixinClockBaseInfo"
),
weixinClockId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockGroupClassifyDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao
;
import
com.pcloud.book.weixinclock.dto.ClassifyInfoDto
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClockGroupClassify
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/15 11:25
*/
@Repository
(
"weixinClockGroupClassifyDao"
)
public
class
WeixinClockGroupClassifyDaoImpl
extends
BaseDaoImpl
<
WeixinClockGroupClassify
>
implements
WeixinClockGroupClassifyDao
{
/**
* 批量插入
* @param groupClassifyIds
*/
@Override
public
void
batchInsert
(
List
<
WeixinClockGroupClassify
>
groupClassifyIds
)
{
super
.
sqlSessionTemplate
.
insert
(
getStatement
(
"batchInsert"
),
groupClassifyIds
);
}
/**
* 获取该群分类下的打卡关键字
* @param paramMap
* @return
*/
@Override
public
String
getKeywordByGroupClassify
(
Map
<
String
,
Object
>
paramMap
)
{
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getKeywordByGroupClassify"
),
paramMap
);
}
/**
* 根据群分类获取某个群的详细信息
* @param bookGroupClassifyId
* @return
*/
@Override
public
WeixinClockDto
getClockBaseInfoByClassify
(
Long
bookGroupClassifyId
)
{
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getClockBaseInfoByClassify"
),
bookGroupClassifyId
);
}
/**
* 获取打卡统计
* @param weixinClockId
* @return
*/
@Override
public
StatisticVO
getClockGroupStatistics
(
Long
weixinClockId
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getClockGroupStatistics"
),
weixinClockId
);
}
/**
* 获取群分类详情
* @param weixinClockId
* @return
*/
@Override
public
List
<
ClassifyInfoDto
>
getClassifyInfo4Update
(
Long
weixinClockId
)
{
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getClassifyInfo4Update"
),
weixinClockId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockMemberDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.pcloud.book.weixinclock.dao.WeixinClockMemberDao
;
import
com.pcloud.book.weixinclock.dto.RankDto
;
import
com.pcloud.book.weixinclock.entity.WeixinClockMember
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/16 9:59
*/
@Repository
(
"weixinClockMemberDao"
)
public
class
WeixinClockMemberDaoImpl
extends
BaseDaoImpl
<
WeixinClockMember
>
implements
WeixinClockMemberDao
{
/**
* 获取某个群内的打卡排行榜
* @param wxGroupId
* @return
*/
@Override
public
List
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxGroupId"
,
wxGroupId
);
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"listWeixinClockRank"
),
paramMap
);
}
/**
* 获取某个群内某用户的信息
* @param userWxId
* @return
*/
@Override
public
WeixinClockMember
getByWxUserId
(
String
wechatGroupId
,
String
userWxId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wechatGroupId"
,
wechatGroupId
);
paramMap
.
put
(
"userWxId"
,
userWxId
);
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getByWxUserId"
),
paramMap
);
}
/**
* 更新打卡天数
* @param userWxId
* @return
*/
@Override
public
void
updateClockDays
(
String
wechatGroupId
,
String
userWxId
,
Long
wechatUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wechatGroupId"
,
wechatGroupId
);
paramMap
.
put
(
"userWxId"
,
userWxId
);
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
super
.
getSqlSession
().
update
(
this
.
getStatement
(
"updateClockDays"
),
paramMap
);
}
/**
* 获取群内最新排名
* @param userWxId
* @return
*/
@Override
public
Integer
getMyNewOrder
(
String
wechatGroupId
,
String
userWxId
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatGroupId"
,
wechatGroupId
);
map
.
put
(
"userWxId"
,
userWxId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getMyNewOrder"
),
map
);
}
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @return
*/
@Override
public
RankDto
getClockWechatUserRank
(
Long
wechatUserId
,
String
wxGroupId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"wechatGroupId"
,
wxGroupId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getClockWechatUserRank"
),
map
);
}
@Override
public
void
updatMemberWechatUserId
(
String
wxUserId
,
Long
wechatUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
super
.
sqlSessionTemplate
.
update
(
getStatement
(
"updatMemberWechatUserId"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockPrizeRecordDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.pcloud.book.weixinclock.dao.WeixinClockPrizeRecordDao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockPrizeRecord
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/23 17:32
*/
@Repository
(
"weixinClockPrizeRecordDao"
)
public
class
WeixinClockPrizeRecordDaoImpl
extends
BaseDaoImpl
<
WeixinClockPrizeRecord
>
implements
WeixinClockPrizeRecordDao
{
@Override
public
int
deleteByWxUserId
(
String
wxUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
return
super
.
sqlSessionTemplate
.
delete
(
getStatement
(
"deleteByWxUserId"
),
paramMap
);
}
@Override
public
WeixinClockPrizeRecord
selectByWxUserIdAndAppId
(
String
wxUserId
,
Long
appId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
paramMap
.
put
(
"appId"
,
appId
);
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"selectByWxUserIdAndAppId"
),
paramMap
);
}
@Override
public
void
updatePrizeTime
(
String
userWxId
,
Long
clockPrizeId
,
Integer
grantNum
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxUserId"
,
userWxId
);
paramMap
.
put
(
"appId"
,
clockPrizeId
);
paramMap
.
put
(
"grantNum"
,
grantNum
);
super
.
sqlSessionTemplate
.
update
(
getStatement
(
"updatePrizeTime"
),
paramMap
);
}
@Override
public
List
<
WeixinClockPrizeRecord
>
getAllPrizeList
(
String
wxUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getAllPrizeList"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockRewardDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.pcloud.book.weixinclock.dao.WeixinClockRewardDao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockReward
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/15 14:04
*/
@Repository
(
"weixinClockRewardDao"
)
public
class
WeixinClockRewardDaoImpl
extends
BaseDaoImpl
<
WeixinClockReward
>
implements
WeixinClockRewardDao
{
@Override
public
void
batchInsert
(
List
<
WeixinClockReward
>
weixinClockRewards
)
{
super
.
sqlSessionTemplate
.
insert
(
getStatement
(
"batchInsert"
),
weixinClockRewards
);
}
@Override
public
List
<
WeixinClockReward
>
listRewardDetail4Adviser
(
Long
weixinClockId
)
{
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"listRewardDetail4Adviser"
),
weixinClockId
);
}
@Override
public
Integer
getGrantNumFromReward
(
Long
weixinClockId
,
Long
clockDays
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"weixinClockId"
,
weixinClockId
);
paramMap
.
put
(
"clockDays"
,
clockDays
);
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getGrantNumFromReward"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockTopicDaoImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dao
.
impl
;
import
com.google.common.collect.Maps
;
import
com.pcloud.book.weixinclock.dao.WeixinClockTopicDao
;
import
com.pcloud.book.weixinclock.entity.WeixinClockTopic
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.utils.DateNewUtils
;
import
org.springframework.stereotype.Repository
;
import
java.util.Map
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/16 11:39
*/
@Repository
(
"weixinClockTopicDao"
)
public
class
WeixinClockTopicDaoImpl
extends
BaseDaoImpl
<
WeixinClockTopic
>
implements
WeixinClockTopicDao
{
/**
* 获取用户今天打卡情况
*/
@Override
public
WeixinClockTopic
getTopicByIds4Today
(
String
wxGroupId
,
String
wxUserId
)
{
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
paramMap
.
put
(
"wxGroupId"
,
wxGroupId
);
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
paramMap
.
put
(
"date"
,
DateNewUtils
.
getShortDateStr
());
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getTopicByIds4Today"
),
paramMap
);
}
/**
* 获得用户的打卡天数
*/
@Override
public
Long
getClockCountByUser
(
String
wxGroupId
,
String
wxUserId
)
{
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
paramMap
.
put
(
"wxGroupId"
,
wxGroupId
);
paramMap
.
put
(
"wxUserId"
,
wxUserId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getClockCountByUser"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dto/ClassifyInfoDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/20 16:39
*/
public
class
ClassifyInfoDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
-
2602004619572932040L
;
@ApiModelProperty
(
"分类标识"
)
private
Long
classifyId
;
@ApiModelProperty
(
"群分类"
)
private
String
classify
;
@ApiModelProperty
(
"群数量"
)
private
Integer
groupsCount
;
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
String
getClassify
()
{
return
classify
;
}
public
void
setClassify
(
String
classify
)
{
this
.
classify
=
classify
;
}
public
Integer
getGroupsCount
()
{
return
groupsCount
;
}
public
void
setGroupsCount
(
Integer
groupsCount
)
{
this
.
groupsCount
=
groupsCount
;
}
@Override
public
String
toString
()
{
return
"ClassifyInfoDto{"
+
"classifyId="
+
classifyId
+
", classify='"
+
classify
+
'\''
+
", groupsCount="
+
groupsCount
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dto/DrawRewardDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 抽奖应用信息
* @date 2019/8/16 14:22
*/
public
class
DrawRewardDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
-
5223468352278026294L
;
@ApiModelProperty
(
"应用标识"
)
private
Long
appId
;
@ApiModelProperty
(
"渠道标识"
)
private
Long
channelId
;
@ApiModelProperty
(
"类型"
)
private
String
typeCode
;
@ApiModelProperty
(
"标题"
)
private
String
title
;
@ApiModelProperty
(
"封面图"
)
private
String
squareImg
;
public
Long
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Long
appId
)
{
this
.
appId
=
appId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
String
getTypeCode
()
{
return
typeCode
;
}
public
void
setTypeCode
(
String
typeCode
)
{
this
.
typeCode
=
typeCode
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getSquareImg
()
{
return
squareImg
;
}
public
void
setSquareImg
(
String
squareImg
)
{
this
.
squareImg
=
squareImg
;
}
@Override
public
String
toString
()
{
return
"DrawRewardDto{"
+
"appId="
+
appId
+
", channelId="
+
channelId
+
", typeCode='"
+
typeCode
+
'\''
+
", title='"
+
title
+
'\''
+
", squareImg='"
+
squareImg
+
'\''
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dto/RankDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/16 17:45
*/
public
class
RankDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1717568387924758933L
;
@ApiModelProperty
(
"排名"
)
private
Integer
rankNum
;
@ApiModelProperty
(
"昵称"
)
private
String
nickname
;
@ApiModelProperty
(
"头像"
)
private
String
headPic
;
@ApiModelProperty
(
"打卡次数"
)
private
Integer
clockNum
;
public
Integer
getRankNum
()
{
return
rankNum
;
}
public
void
setRankNum
(
Integer
rankNum
)
{
this
.
rankNum
=
rankNum
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getHeadPic
()
{
return
headPic
;
}
public
void
setHeadPic
(
String
headPic
)
{
this
.
headPic
=
headPic
;
}
public
Integer
getClockNum
()
{
return
clockNum
;
}
public
void
setClockNum
(
Integer
clockNum
)
{
this
.
clockNum
=
clockNum
;
}
@Override
public
String
toString
()
{
return
"RankDto{"
+
"rankNum="
+
rankNum
+
", nickname='"
+
nickname
+
'\''
+
", headPic='"
+
headPic
+
'\''
+
", clockNum="
+
clockNum
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dto/WeixinClockDto.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.book.weixinclock.entity.WeixinClockReward
;
import
com.pcloud.common.dto.BaseDto
;
import
java.util.Date
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description dto
* @date 2019/8/15 9:13
*/
public
class
WeixinClockDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
2919177537250026356L
;
@ApiModelProperty
(
"weixinClockId"
)
private
Long
weixinClockId
;
@ApiModelProperty
(
"群统计信息"
)
private
StatisticVO
statisticVO
;
@ApiModelProperty
(
"抽奖应用信息"
)
private
DrawRewardDto
drawRewardDto
;
@ApiModelProperty
(
"打卡奖励集合"
)
private
List
<
WeixinClockReward
>
weixinClockRewards
;
@ApiModelProperty
(
"群分类详情"
)
private
List
<
ClassifyInfoDto
>
classifyInfoDtos
;
@ApiModelProperty
(
"群分类集合"
)
private
List
<
Long
>
groupClassifyIds
;
@ApiModelProperty
(
"打卡关键词"
)
private
String
clockKeyword
;
@ApiModelProperty
(
"打卡引导语"
)
private
String
clockGuide
;
@ApiModelProperty
(
"打卡简介"
)
private
String
clockIntroduction
;
@ApiModelProperty
(
"打卡奖励ID"
)
private
Long
clockPrizeId
;
@ApiModelProperty
(
"打卡奖励URL"
)
private
String
clockPrizeUrl
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
"最近修改人"
)
private
Long
lastModifiedUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"最近修改时间"
)
private
Date
lastModifiedDate
;
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
public
StatisticVO
getStatisticVO
()
{
return
statisticVO
;
}
public
void
setStatisticVO
(
StatisticVO
statisticVO
)
{
this
.
statisticVO
=
statisticVO
;
}
public
DrawRewardDto
getDrawRewardDto
()
{
return
drawRewardDto
;
}
public
void
setDrawRewardDto
(
DrawRewardDto
drawRewardDto
)
{
this
.
drawRewardDto
=
drawRewardDto
;
}
public
List
<
WeixinClockReward
>
getWeixinClockRewards
()
{
return
weixinClockRewards
;
}
public
void
setWeixinClockRewards
(
List
<
WeixinClockReward
>
weixinClockRewards
)
{
this
.
weixinClockRewards
=
weixinClockRewards
;
}
public
List
<
ClassifyInfoDto
>
getClassifyInfoDtos
()
{
return
classifyInfoDtos
;
}
public
void
setClassifyInfoDtos
(
List
<
ClassifyInfoDto
>
classifyInfoDtos
)
{
this
.
classifyInfoDtos
=
classifyInfoDtos
;
}
public
List
<
Long
>
getGroupClassifyIds
()
{
return
groupClassifyIds
;
}
public
void
setGroupClassifyIds
(
List
<
Long
>
groupClassifyIds
)
{
this
.
groupClassifyIds
=
groupClassifyIds
;
}
public
String
getClockKeyword
()
{
return
clockKeyword
;
}
public
void
setClockKeyword
(
String
clockKeyword
)
{
this
.
clockKeyword
=
clockKeyword
;
}
public
String
getClockGuide
()
{
return
clockGuide
;
}
public
void
setClockGuide
(
String
clockGuide
)
{
this
.
clockGuide
=
clockGuide
;
}
public
String
getClockIntroduction
()
{
return
clockIntroduction
;
}
public
void
setClockIntroduction
(
String
clockIntroduction
)
{
this
.
clockIntroduction
=
clockIntroduction
;
}
public
Long
getClockPrizeId
()
{
return
clockPrizeId
;
}
public
void
setClockPrizeId
(
Long
clockPrizeId
)
{
this
.
clockPrizeId
=
clockPrizeId
;
}
public
String
getClockPrizeUrl
()
{
return
clockPrizeUrl
;
}
public
void
setClockPrizeUrl
(
String
clockPrizeUrl
)
{
this
.
clockPrizeUrl
=
clockPrizeUrl
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
@Override
public
Long
getLastModifiedUser
()
{
return
lastModifiedUser
;
}
@Override
public
void
setLastModifiedUser
(
Long
lastModifiedUser
)
{
this
.
lastModifiedUser
=
lastModifiedUser
;
}
@Override
public
Date
getLastModifiedDate
()
{
return
lastModifiedDate
;
}
@Override
public
void
setLastModifiedDate
(
Date
lastModifiedDate
)
{
this
.
lastModifiedDate
=
lastModifiedDate
;
}
@Override
public
String
toString
()
{
return
"WeixinClockDto{"
+
"weixinClockId="
+
weixinClockId
+
", statisticVO="
+
statisticVO
+
", drawRewardDto="
+
drawRewardDto
+
", weixinClockRewards="
+
weixinClockRewards
+
", classifyInfoDtos="
+
classifyInfoDtos
+
", groupClassifyIds="
+
groupClassifyIds
+
", clockKeyword='"
+
clockKeyword
+
'\''
+
", clockGuide='"
+
clockGuide
+
'\''
+
", clockIntroduction='"
+
clockIntroduction
+
'\''
+
", clockPrizeId="
+
clockPrizeId
+
", clockPrizeUrl='"
+
clockPrizeUrl
+
'\''
+
", createUser="
+
createUser
+
", createDate="
+
createDate
+
", lastModifiedUser="
+
lastModifiedUser
+
", lastModifiedDate="
+
lastModifiedDate
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClock.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 微信打卡
* @date 2019/8/14 19:49
*/
public
class
WeixinClock
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
5405036821243584401L
;
@ApiModelProperty
(
"weixinClockId"
)
private
Long
weixinClockId
;
@ApiModelProperty
(
"打卡关键词"
)
private
String
clockKeyword
;
@ApiModelProperty
(
"打卡引导语"
)
private
String
clockGuide
;
@ApiModelProperty
(
"打卡简介"
)
private
String
clockIntroduction
;
@ApiModelProperty
(
"打卡奖励ID"
)
private
Long
clockPrizeId
;
@ApiModelProperty
(
"打卡奖励URL"
)
private
String
clockPrizeUrl
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
"最近修改人"
)
private
Long
lastModifiedUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"最近修改时间"
)
private
Date
lastModifiedDate
;
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
public
String
getClockKeyword
()
{
return
clockKeyword
;
}
public
void
setClockKeyword
(
String
clockKeyword
)
{
this
.
clockKeyword
=
clockKeyword
;
}
public
String
getClockGuide
()
{
return
clockGuide
;
}
public
void
setClockGuide
(
String
clockGuide
)
{
this
.
clockGuide
=
clockGuide
;
}
public
String
getClockIntroduction
()
{
return
clockIntroduction
;
}
public
void
setClockIntroduction
(
String
clockIntroduction
)
{
this
.
clockIntroduction
=
clockIntroduction
;
}
public
Long
getClockPrizeId
()
{
return
clockPrizeId
;
}
public
void
setClockPrizeId
(
Long
clockPrizeId
)
{
this
.
clockPrizeId
=
clockPrizeId
;
}
public
String
getClockPrizeUrl
()
{
return
clockPrizeUrl
;
}
public
void
setClockPrizeUrl
(
String
clockPrizeUrl
)
{
this
.
clockPrizeUrl
=
clockPrizeUrl
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
Long
getLastModifiedUser
()
{
return
lastModifiedUser
;
}
public
void
setLastModifiedUser
(
Long
lastModifiedUser
)
{
this
.
lastModifiedUser
=
lastModifiedUser
;
}
public
Date
getLastModifiedDate
()
{
return
lastModifiedDate
;
}
public
void
setLastModifiedDate
(
Date
lastModifiedDate
)
{
this
.
lastModifiedDate
=
lastModifiedDate
;
}
@Override
public
String
toString
()
{
return
"WeixinClock{"
+
"weixinClockId="
+
weixinClockId
+
", clockKeyword='"
+
clockKeyword
+
'\''
+
", clockGuide='"
+
clockGuide
+
'\''
+
", clockIntroduction='"
+
clockIntroduction
+
'\''
+
", clockPrizeId="
+
clockPrizeId
+
", clockPrizeUrl='"
+
clockPrizeUrl
+
'\''
+
", createUser="
+
createUser
+
", createDate="
+
createDate
+
", lastModifiedUser="
+
lastModifiedUser
+
", lastModifiedDate="
+
lastModifiedDate
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClockGroupClassify.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 群分类
* @date 2019/8/15 11:31
*/
public
class
WeixinClockGroupClassify
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
8053226115622528631L
;
@ApiModelProperty
(
"weixinClockGroupClassifyId"
)
private
Long
weixinClockGroupClassifyId
;
@ApiModelProperty
(
"群分类ID"
)
private
Long
bookGroupClassifyId
;
@ApiModelProperty
(
"微信群签到打卡ID"
)
private
Long
weixinClockId
;
public
Long
getWeixinClockGroupClassifyId
()
{
return
weixinClockGroupClassifyId
;
}
public
void
setWeixinClockGroupClassifyId
(
Long
weixinClockGroupClassifyId
)
{
this
.
weixinClockGroupClassifyId
=
weixinClockGroupClassifyId
;
}
public
Long
getBookGroupClassifyId
()
{
return
bookGroupClassifyId
;
}
public
void
setBookGroupClassifyId
(
Long
bookGroupClassifyId
)
{
this
.
bookGroupClassifyId
=
bookGroupClassifyId
;
}
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
@Override
public
String
toString
()
{
return
"WeixinClockGroupClassify{"
+
"weixinClockGroupClassifyId="
+
weixinClockGroupClassifyId
+
", bookGroupClassifyId="
+
bookGroupClassifyId
+
", weixinClockId="
+
weixinClockId
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClockMember.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 打卡成员
* @date 2019/8/16 9:53
*/
public
class
WeixinClockMember
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
4437962905235665251L
;
@ApiModelProperty
(
"主键"
)
private
Long
weixinClockMemberId
;
@ApiModelProperty
(
"签到打卡标识"
)
private
Long
weixinClockId
;
@ApiModelProperty
(
"微信用户标识"
)
private
String
wxUserId
;
@ApiModelProperty
(
"群分类标识"
)
private
Long
bookGroupClassifyId
;
@ApiModelProperty
(
"群标识"
)
private
String
wxGroupId
;
@ApiModelProperty
(
"昵称"
)
private
String
nickname
;
@ApiModelProperty
(
"头像"
)
private
String
headPic
;
@ApiModelProperty
(
"打卡天数"
)
private
Integer
allClockDay
;
@ApiModelProperty
(
"微信用户ID"
)
private
Long
wechatUserId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
public
Long
getWeixinClockMemberId
()
{
return
weixinClockMemberId
;
}
public
void
setWeixinClockMemberId
(
Long
weixinClockMemberId
)
{
this
.
weixinClockMemberId
=
weixinClockMemberId
;
}
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
Long
getBookGroupClassifyId
()
{
return
bookGroupClassifyId
;
}
public
void
setBookGroupClassifyId
(
Long
bookGroupClassifyId
)
{
this
.
bookGroupClassifyId
=
bookGroupClassifyId
;
}
public
String
getWxGroupId
()
{
return
wxGroupId
;
}
public
void
setWxGroupId
(
String
wxGroupId
)
{
this
.
wxGroupId
=
wxGroupId
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
public
String
getHeadPic
()
{
return
headPic
;
}
public
void
setHeadPic
(
String
headPic
)
{
this
.
headPic
=
headPic
;
}
public
Integer
getAllClockDay
()
{
return
allClockDay
;
}
public
void
setAllClockDay
(
Integer
allClockDay
)
{
this
.
allClockDay
=
allClockDay
;
}
public
Long
getWechatUserId
()
{
return
wechatUserId
;
}
public
void
setWechatUserId
(
Long
wechatUserId
)
{
this
.
wechatUserId
=
wechatUserId
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Override
public
String
toString
()
{
return
"WeixinClockMember{"
+
"weixinClockMemberId="
+
weixinClockMemberId
+
", weixinClockId="
+
weixinClockId
+
", wxUserId='"
+
wxUserId
+
'\''
+
", bookGroupClassifyId="
+
bookGroupClassifyId
+
", wxGroupId='"
+
wxGroupId
+
'\''
+
", nickname='"
+
nickname
+
'\''
+
", headPic='"
+
headPic
+
'\''
+
", allClockDay="
+
allClockDay
+
", wechatUserId="
+
wechatUserId
+
", createTime="
+
createTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClockPrizeRecord.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 奖励记录表
* @date 2019/8/23 17:20
*/
public
class
WeixinClockPrizeRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
8507834064618771705L
;
@ApiModelProperty
(
"主键标识"
)
private
Long
weixinClockPrizeRecordId
;
@ApiModelProperty
(
"微信ID"
)
private
String
wxUserId
;
@ApiModelProperty
(
"微信用户ID"
)
private
Long
wechatUserId
;
@ApiModelProperty
(
"奖励appId"
)
private
Long
clockPrizeId
;
@ApiModelProperty
(
"奖励次数"
)
private
Integer
prizeTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
public
Long
getWeixinClockPrizeRecordId
()
{
return
weixinClockPrizeRecordId
;
}
public
void
setWeixinClockPrizeRecordId
(
Long
weixinClockPrizeRecordId
)
{
this
.
weixinClockPrizeRecordId
=
weixinClockPrizeRecordId
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
Long
getWechatUserId
()
{
return
wechatUserId
;
}
public
void
setWechatUserId
(
Long
wechatUserId
)
{
this
.
wechatUserId
=
wechatUserId
;
}
public
Long
getClockPrizeId
()
{
return
clockPrizeId
;
}
public
void
setClockPrizeId
(
Long
clockPrizeId
)
{
this
.
clockPrizeId
=
clockPrizeId
;
}
public
Integer
getPrizeTime
()
{
return
prizeTime
;
}
public
void
setPrizeTime
(
Integer
prizeTime
)
{
this
.
prizeTime
=
prizeTime
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Override
public
Date
getUpdateTime
()
{
return
updateTime
;
}
@Override
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
@Override
public
String
toString
()
{
return
"WeixinClockPrizeRecord{"
+
"weixinClockPrizeRecordId="
+
weixinClockPrizeRecordId
+
", wxUserId='"
+
wxUserId
+
'\''
+
", wechatUserId="
+
wechatUserId
+
", clockPrizeId="
+
clockPrizeId
+
", prizeTime="
+
prizeTime
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClockReward.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description TODO
* @date 2019/8/15 14:05
*/
public
class
WeixinClockReward
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
4061202053963659184L
;
@ApiModelProperty
(
"微信群签到打卡奖励ID"
)
private
Long
weixinClockRewardId
;
@ApiModelProperty
(
"微信群签到打卡ID"
)
private
Long
weixinClockId
;
@ApiModelProperty
(
"获取奖励需要的打卡天数"
)
private
Integer
clockDays
;
@ApiModelProperty
(
"获取到的抽奖次数"
)
private
Integer
rewardNum
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
public
Long
getWeixinClockRewardId
()
{
return
weixinClockRewardId
;
}
public
void
setWeixinClockRewardId
(
Long
weixinClockRewardId
)
{
this
.
weixinClockRewardId
=
weixinClockRewardId
;
}
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
public
Integer
getClockDays
()
{
return
clockDays
;
}
public
void
setClockDays
(
Integer
clockDays
)
{
this
.
clockDays
=
clockDays
;
}
public
Integer
getRewardNum
()
{
return
rewardNum
;
}
public
void
setRewardNum
(
Integer
rewardNum
)
{
this
.
rewardNum
=
rewardNum
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Override
public
String
toString
()
{
return
"WeixinClockReward{"
+
"weixinClockRewardId="
+
weixinClockRewardId
+
", weixinClockId="
+
weixinClockId
+
", clockDays="
+
clockDays
+
", rewardNum="
+
rewardNum
+
", createTime="
+
createTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/entity/WeixinClockTopic.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author 杨涛
* @description 打卡记录
* @date 2019/8/16 10:42
*/
public
class
WeixinClockTopic
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
2573601301200332849L
;
@ApiModelProperty
(
"打卡记录标识"
)
private
Long
weixinClockTopicId
;
@ApiModelProperty
(
"微信群签到打卡标识"
)
private
Long
weixinClockId
;
@ApiModelProperty
(
"打卡成员标识"
)
private
Long
weixinClockMemberId
;
@ApiModelProperty
(
"微信用户标识"
)
private
String
wxUserId
;
@ApiModelProperty
(
"群分类标识"
)
private
Long
bookGroupClassifyId
;
@ApiModelProperty
(
"微信群标识"
)
private
String
wxGroupId
;
@ApiModelProperty
(
"打卡日期"
)
private
Date
createdDay
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
public
Long
getWeixinClockTopicId
()
{
return
weixinClockTopicId
;
}
public
void
setWeixinClockTopicId
(
Long
weixinClockTopicId
)
{
this
.
weixinClockTopicId
=
weixinClockTopicId
;
}
public
Long
getWeixinClockId
()
{
return
weixinClockId
;
}
public
void
setWeixinClockId
(
Long
weixinClockId
)
{
this
.
weixinClockId
=
weixinClockId
;
}
public
Long
getWeixinClockMemberId
()
{
return
weixinClockMemberId
;
}
public
void
setWeixinClockMemberId
(
Long
weixinClockMemberId
)
{
this
.
weixinClockMemberId
=
weixinClockMemberId
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
Long
getBookGroupClassifyId
()
{
return
bookGroupClassifyId
;
}
public
void
setBookGroupClassifyId
(
Long
bookGroupClassifyId
)
{
this
.
bookGroupClassifyId
=
bookGroupClassifyId
;
}
public
String
getWxGroupId
()
{
return
wxGroupId
;
}
public
void
setWxGroupId
(
String
wxGroupId
)
{
this
.
wxGroupId
=
wxGroupId
;
}
public
Date
getCreatedDay
()
{
return
createdDay
;
}
public
void
setCreatedDay
(
Date
createdDay
)
{
this
.
createdDay
=
createdDay
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Override
public
String
toString
()
{
return
"WeixinClockTopicDao{"
+
"weixinClockTopicId="
+
weixinClockTopicId
+
", weixinClockId="
+
weixinClockId
+
", weixinClockMemberId="
+
weixinClockMemberId
+
", wxUserId='"
+
wxUserId
+
'\''
+
", bookGroupClassifyId="
+
bookGroupClassifyId
+
", wxGroupId='"
+
wxGroupId
+
'\''
+
", createdDay="
+
createdDay
+
", createTime="
+
createTime
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/facade/WeixinClockFacade.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
facade
;
import
com.pcloud.book.group.vo.BookGroupClassifyVO
;
import
com.pcloud.book.group.vo.ListGroupClassifyParam
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
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
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
/**
* @author 杨涛
* @description 接口层
* @date 2019/8/14 19:15
*/
@FeignClient
(
value
=
"pcloud-service-book"
,
qualifier
=
"weixinClockFacadeCloud"
,
path
=
"weixinClock"
)
@Api
(
description
=
"微信群签到打卡"
)
public
interface
WeixinClockFacade
{
@ApiOperation
(
value
=
"创建微信群签到打卡"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"weixinClockDto"
,
value
=
"微信群签到打卡实体"
,
dataType
=
"WeixinClockDto"
,
paramType
=
"body"
)})
@RequestMapping
(
value
=
"createWeixinClock"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
createWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
WeixinClockDto
weixinClockDto
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"获取微信群签到打卡信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"weixinClockId"
,
value
=
"weixinClockId"
,
dataType
=
"Long"
,
paramType
=
"query"
)})
@RequestMapping
(
value
=
"getWeixinClockBaseInfo"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getWeixinClockBaseInfo
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"weixinClockId"
,
required
=
false
)
Long
weixinClockId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"获取编辑所有的分类"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"listGroupClassifyParam"
,
value
=
"获取分类列表参数"
,
dataType
=
"ListGroupClassifyParam"
,
paramType
=
"body"
)})
@RequestMapping
(
value
=
"listGroupClassify4Clock"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<
PageBeanNew
<
BookGroupClassifyVO
>>
listGroupClassify4Clock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
(
"获取分类列表参数"
)
ListGroupClassifyParam
listGroupClassifyParam
)
throws
PermissionException
;
@ApiOperation
(
value
=
"修改微信群签到打卡"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"weixinClockDto"
,
value
=
"微信群签到打卡实体"
,
dataType
=
"WeixinClockDto"
,
paramType
=
"body"
)})
@RequestMapping
(
value
=
"updateWeixinClock"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
updateWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
WeixinClockDto
weixinClockDto
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"删除微信群签到打卡"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"weixinClockId"
,
value
=
"weixinClockId"
,
dataType
=
"Long"
,
paramType
=
"query"
)})
@RequestMapping
(
value
=
"deleteWeixinClock"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
deleteWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"weixinClockId"
,
required
=
false
)
Long
weixinClockId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"微信群签到打卡列表(编辑端)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"打卡关键字"
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"当前页"
,
dataType
=
"Integer"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"每页大小"
,
dataType
=
"Integer"
,
paramType
=
"query"
)})
@RequestMapping
(
value
=
"listWeixinClock4Adviser"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
listWeixinClock4Adviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"获取某个微信群签到打卡的所有群分类详情"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"weixinClockId"
,
value
=
"weixinClockId"
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"当前页"
,
dataType
=
"Integer"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"每页大小"
,
dataType
=
"Integer"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"listGroupClassifyDetail4Clock"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
listGroupClassifyDetail4Clock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"weixinClockId"
)
Long
weixinClockId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取某个群内的打卡排行榜"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userInfo"
,
value
=
"Cookie"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"wxGroupId"
,
value
=
"wxGroupId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"wxUserId"
,
value
=
"wxUserId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"当前页"
,
dataType
=
"Integer"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"每页大小"
,
dataType
=
"Integer"
,
paramType
=
"query"
)})
@RequestMapping
(
value
=
"listWeixinClockRank"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
listWeixinClockRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取某个群内某个用户的信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userInfo"
,
value
=
"Cookie"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"wxGroupId"
,
value
=
"wxGroupId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"wxUserId"
,
value
=
"wxUserId"
,
dataType
=
"string"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getClockWechatUserRank"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getClockWechatUserRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
0 → 100644
View file @
3d73fa9d
package
com
.
pcloud
.
book
.
weixinclock
.
facade
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.group.vo.BookGroupClassifyVO
;
import
com.pcloud.book.group.vo.ListGroupClassifyParam
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.facade.WeixinClockFacade
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
import
io.swagger.annotations.ApiParam
;
/**
* @author 杨涛
* @description 接口实现层
* @date 2019/8/14 19:15
*/
@RequestMapping
(
"/weixinClock"
)
@RestController
(
"weixinClockFacade"
)
public
class
WeixinClockFacadeImpl
implements
WeixinClockFacade
{
@Autowired
private
WeixinClockBiz
weixinClockBiz
;
/**
* 创建微信群签到打卡
* @param token
* @param weixinClockDto
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"createWeixinClock"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
createWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
WeixinClockDto
weixinClockDto
)
throws
BizException
,
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
weixinClockDto
.
setCreateUser
(
adviserId
);
weixinClockDto
.
setLastModifiedUser
(
adviserId
);
return
new
ResponseDto
<>(
weixinClockBiz
.
createWeixinClock
(
weixinClockDto
));
}
/**
* 获取微信群签到打卡信息
* @param token
* @param weixinClockId
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"getWeixinClockBaseInfo"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getWeixinClockBaseInfo
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"weixinClockId"
,
required
=
false
)
Long
weixinClockId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
weixinClockBiz
.
getWeixinClockBaseInfo
(
weixinClockId
));
}
@Override
@RequestMapping
(
value
=
"listGroupClassify4Clock"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<
PageBeanNew
<
BookGroupClassifyVO
>>
listGroupClassify4Clock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListGroupClassifyParam
listGroupClassifyParam
)
throws
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
weixinClockBiz
.
listGroupClassify4Clock
(
listGroupClassifyParam
,
adviserId
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
/**
* 修改微信群签到打卡
* @param token
* @param weixinClockDto
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"updateWeixinClock"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
updateWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
WeixinClockDto
weixinClockDto
)
throws
BizException
,
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
null
==
weixinClockDto
||
null
==
weixinClockDto
.
getWeixinClockId
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误"
);
}
weixinClockDto
.
setLastModifiedUser
(
adviserId
);
weixinClockBiz
.
updateWeixinClock
(
weixinClockDto
);
return
new
ResponseDto
<>();
}
/**
* 删除微信群签到打卡
* @param token
* @param weixinClockId
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"deleteWeixinClock"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
deleteWeixinClock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"weixinClockId"
,
required
=
false
)
Long
weixinClockId
)
throws
BizException
,
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
null
==
weixinClockId
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
weixinClockBiz
.
deleteWeixinClock
(
weixinClockId
,
adviserId
);
return
new
ResponseDto
<>();
}
/**
* 微信群签到打卡列表(编辑端)
* @param token
* @param keyword
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"listWeixinClock4Adviser"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
listWeixinClock4Adviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
null
==
currentPage
||
null
==
numPerPage
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"分页参数有误"
);
}
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"keyword"
,
keyword
!=
null
&&
""
.
equals
(
keyword
.
trim
())
?
null
:
keyword
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
new
ResponseDto
<>(
weixinClockBiz
.
listWeixinClock4Adviser
(
pageParam
,
paramMap
));
}
/**
* 获取某个微信群签到打卡的所有群分类详情
* @param token
* @param weixinClockId
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"listGroupClassifyDetail4Clock"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
listGroupClassifyDetail4Clock
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"weixinClockId"
)
Long
weixinClockId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
weixinClockBiz
.
listGroupClassifyDetail4Clock
(
weixinClockId
,
currentPage
,
numPerPage
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
/**
* 获取某个群内的打卡排行榜
* @param userInfo
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"listWeixinClockRank"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
listWeixinClockRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
weixinClockBiz
.
listWeixinClockRank
(
wxGroupId
,
wxUserId
,
currentPage
,
numPerPage
));
}
/**
* 获取某个群内某个用户的信息
* @param userInfo
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"getClockWechatUserRank"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getClockWechatUserRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
weixinClockBiz
.
getClockWechatUserRank
(
wechatUserId
,
wxGroupId
,
wxUserId
));
}
}
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
3d73fa9d
...
...
@@ -458,6 +458,7 @@
LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME
<![CDATA[ > ]]>
NOW() AND BF.START_TIME
<![CDATA[ < ]]>
NOW()
LEFT JOIN book_auth_info I ON I.BOOK_ID = A.BOOK_ID AND I.ADVISER_ID = #{adviserId}
LEFT JOIN book_group G on G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID AND G.IS_DELETE = 0
LEFT JOIN book_freeze f ON B.BOOK_ID = f.BOOK_ID
WHERE
1=1
<if
test=
"bookId!=null"
>
...
...
@@ -489,8 +490,10 @@
A.IS_MAIN_EDITOR = 1
</if>
<if
test=
"isFundSupport != null"
>
AND
BF.BOOK_FUND_ID IS NOT NULL
AND (
BF.BOOK_FUND_ID IS NOT NULL
OR f.IS_FREEZE = 1
)
</if>
<if
test=
"templetId != null"
>
AND
...
...
pcloud-service-book/src/main/resources/mapper/clock/BookClockInfo.Mapper.xml
View file @
3d73fa9d
...
...
@@ -198,5 +198,10 @@
WHERE book_clock_info_id = #{bookClockInfoId}
</delete>
<select
id=
"getAllClockInfoIds"
parameterType=
"map"
resultMap=
"BaseResultMapDTO"
>
select
<include
refid=
"Base_Column_List"
/>
from book_clock_info where origin_type = 'APP'
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/clock/BookGroupClock.Mapper.xml
View file @
3d73fa9d
...
...
@@ -140,5 +140,31 @@
WHERE book_clock_info_id = #{bookClockInfoId}
</delete>
<select
id=
"getClassifyIdsByBookGroupId"
parameterType=
"map"
resultType=
"Long"
>
SELECT DISTINCT
t2.id
FROM
book_group_clock t1
LEFT JOIN book_group_classify t2 ON t1.book_group_id = t2.book_group_id
LEFT JOIN weixin_clock_group_classify t3 ON t2.id = t3.book_group_classify_id
WHERE
t2.is_delete = 0
AND t3.weixin_clock_group_classify_id IS NULL
AND t1.book_clock_info_id = #{bookClockInfoId}
</select>
<select
id=
"getClassifyIdsByClassfyId"
parameterType=
"map"
resultType=
"Long"
>
SELECT DISTINCT
t2.id
FROM
book_group_clock t1
LEFT JOIN book_group_classify t2 ON t1.classify_id = t2.id
LEFT JOIN weixin_clock_group_classify t3 ON t2.id = t3.book_group_classify_id
WHERE
t2.is_delete = 0
AND t3.weixin_clock_group_classify_id IS NULL
AND t1.book_clock_info_id = #{bookClockInfoId}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/AppClickRecord.xml
View file @
3d73fa9d
...
...
@@ -65,6 +65,18 @@
t.serve_id
</select>
<select
id=
"getClickStatistics"
parameterType=
"map"
resultType=
"com.pcloud.book.group.vo.ResourcesStatisticVO"
>
select serve_id rescourceId, count(1) browseCount from app_click_record
where book_group_id = #{bookGroupId} and serve_type = #{type}
<if
test=
"classifyId != null"
>
and classify_id = #{classifyId}
</if>
<if
test=
"qrcodeId!=null"
>
AND qrcode_id = #{qrcodeId}
</if>
group by serve_id
</select>
<!--获取最近点击-->
<select
id=
"getRecentlyClick"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.AppClickDTO"
>
select
...
...
@@ -81,4 +93,81 @@
order by create_time desc
limit #{top}
</select>
<select
id=
"getClickTrend"
parameterType=
"com.pcloud.book.group.vo.GroupScanTrendParamVO"
resultType=
"com.pcloud.book.group.vo.GroupScanTrendVO"
>
select DATE_FORMAT(create_time, '%Y-%m-%d') date, count(1) scanCount from app_click_record
where book_group_id = #{bookGroupId}
<if
test=
"classifyId != null"
>
and classify_id = #{classifyId}
</if>
<if
test=
"wxGroupId != null"
>
and qrcode_id = #{wxGroupId}
</if>
and create_time
>
=
<if
test=
"startDate == null"
>
DATE_FORMAT(SUBDATE(NOW(), INTERVAL #{dayNum} DAY),'%Y-%m-%d')
AND create_time
<
DATE_FORMAT(now(), '%Y-%m-%d')
</if>
<if
test=
"startDate != null"
>
DATE_FORMAT(#{startDate},'%Y-%m-%d')
AND create_time
<
= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
GROUP BY date
order by date
</select>
<select
id=
"getResourceClick"
parameterType=
"map"
resultType=
"com.pcloud.book.group.vo.ResourceClickVO"
>
SELECT
t.serve_id rescourceId,
count(1) clickCount
FROM
app_click_record t
WHERE
t.serve_id IN
<foreach
collection=
"rescourceIds"
index=
"index"
item=
"item"
close=
")"
open=
"("
separator=
","
>
#{item}
</foreach>
<if
test=
"bookGroupId!=null"
>
AND t.book_group_id = #{bookGroupId}
</if>
<if
test=
"classifyId!=null"
>
AND t.classify_id = #{classifyId}
</if>
<if
test=
"qrcodeId!=null"
>
AND t.qrcode_id = #{qrcodeId}
</if>
<if
test=
"type!=null"
>
AND t.serve_type = #{type}
</if>
GROUP BY
t.serve_id
</select>
<select
id=
"getRescourceTotalClick"
parameterType=
"map"
resultType=
"long"
>
select count(1) FROM app_click_record t
WHERE t.book_group_id = #{bookGroupId}
<if
test=
"classifyId!=null"
>
AND t.classify_id = #{classifyId}
</if>
<if
test=
"qrcodeId!=null"
>
AND t.qrcode_id = #{qrcodeId}
</if>
<if
test=
"type!=null"
>
AND t.serve_type = #{type}
</if>
</select>
<select
id=
"getRescourceIds"
parameterType=
"map"
resultType=
"long"
>
select t.serve_id FROM app_click_record t
WHERE t.book_group_id = #{bookGroupId}
<if
test=
"classifyId!=null"
>
AND t.classify_id = #{classifyId}
</if>
<if
test=
"qrcodeId!=null"
>
AND t.qrcode_id = #{qrcodeId}
</if>
<if
test=
"type!=null"
>
AND t.serve_type = #{type}
</if>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/AppTouchRecord.xml
View file @
3d73fa9d
...
...
@@ -62,4 +62,8 @@
t.serve_id
order by t.create_time desc
</select>
<select
id=
"getCountByBokkGroupId"
parameterType=
"map"
resultType=
"long"
>
select count(1) from app_touch_record where book_group_id =#{bookGroupId} and serve_type = #{type}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupClassify.Mapper.xml
View file @
3d73fa9d
...
...
@@ -183,6 +183,24 @@
id = #{_parameter,jdbcType=BIGINT}
</select>
<resultMap
id=
"getClassifyByIdsMap"
type=
"com.pcloud.book.group.entity.BookGroupClassify"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"classify"
column=
"classify"
/>
</resultMap>
<!--根据id获取分类-->
<select
id=
"getClassifyByIds"
parameterType=
"list"
resultMap=
"getClassifyByIdsMap"
>
SELECT
id id,classify classify
FROM
book_group_classify
WHERE
is_delete= 0
AND
id IN
<foreach
collection=
"list"
index=
"index"
open=
"("
close=
")"
item=
"item"
separator=
","
>
${item}
</foreach>
</select>
<select
id=
"listAllClassifyByRank"
resultType=
"ListClassifyVO"
parameterType=
"Long"
>
select
...
...
@@ -191,7 +209,8 @@
classify_introduce classifyIntroduce,
price,
change_number changeNumber,
rank
rank,
create_time createdTime
from
book_group_classify
where
...
...
@@ -207,7 +226,8 @@
change_number changeNumber,
rank,
count(1) qrcodeNumber,
SUM(user_number) userNumberTotal
SUM(user_number) userNumberTotal,
c.create_time createdTime
from
book_group_classify c join book_group_qrcode q on c.id = q.classify_id
where
...
...
@@ -427,6 +447,55 @@
order by c.id desc, g.id desc
</select>
<select
id=
"listGroupClassify4Clock"
resultType=
"com.pcloud.book.group.vo.BookGroupClassifyVO"
parameterType=
"map"
>
SELECT
c.id classifyId,
count(DISTINCT g.id) groupsCount,
c.book_id bookId,
b.BOOK_NAME bookName,
c.classify,
c.book_group_id bookGroupId,
bg.group_qrcode_name groupQrcodeName,
sum(IFNULL(g.user_number,0)) userNumber,
bg.pro_label_id proLabelId,
bg.dep_label_id depLabelId,
bg.pur_label_id purLabelId
FROM book_group_classify c
INNER JOIN book_group_qrcode g ON c.id = g.classify_id
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN book b ON c.book_id = b.book_id
LEFT JOIN weixin_clock_group_classify wc ON c.id = wc.book_group_classify_id
WHERE c.is_delete = 0
AND g.is_delete = 0
AND bg.is_delete = 0
AND b.is_delete = 0
AND wc.weixin_clock_group_classify_id is null
AND c.create_user = #{adviserId}
<if
test=
"bookIds != null"
>
AND c.book_id IN
<foreach
collection =
"bookIds"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
${item}
</foreach>
</if>
<if
test=
"name != null"
>
AND (
book_name LIKE CONCAT('%', #{name},'%')
OR c.classify LIKE CONCAT('%', #{name},'%')
)
</if>
<if
test=
"proLabelId!=null"
>
and bg.pro_label_id=#{proLabelId}
</if>
<if
test=
"depLabelId!=null"
>
and bg.dep_label_id=#{depLabelId}
</if>
<if
test=
"purLabelId!=null"
>
and bg.pur_label_id=#{purLabelId}
</if>
group by c.id
order by c.id desc, g.id desc
</select>
<select
id=
"listGroupQrcode4Platform"
resultType=
"GroupQrcodeVO"
parameterType=
"map"
>
SELECT
g.id groupQrcodeId,
...
...
@@ -805,6 +874,16 @@
book_group_classify c join book_group_qrcode q on c.id = q.classify_id
and q.group_name = #{_parameter} limit 1
</select>
<select
id=
"getGroupClassifyCount"
parameterType=
"list"
resultType=
"map"
>
select book_id bookId, count(1) classifyCount, book_group_id bookGroupId from book_group_classify
where is_delete = 0 and book_id in
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
group by book_id
</select>
<!--更新是否开启学习报告-->
<update
id=
"updateHasOpenLearningReport"
parameterType=
"map"
>
update book_group_classify set
...
...
@@ -814,6 +893,24 @@
where id=#{classifyId}
</update>
<insert
id=
"addClickClassify"
parameterType=
"map"
>
insert into book_group_classify_click(book_group_id, classify_id,create_user, create_time)
values(#{bookGroupId},#{classifyId},#{wechatUserId},now())
</insert>
<select
id=
"mapClickClassify"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.ClickClassifyDTO"
>
select classify_id classifyId, count(1) count from book_group_classify_click
where classify_id in
<foreach
collection=
"classifyIds"
open=
"("
close=
")"
separator=
","
item=
"id"
>
#{id}
</foreach>
group by classify_id
</select>
<select
id=
"getClassifyIngoreDelete"
parameterType=
"long"
resultType=
"com.pcloud.book.group.vo.ListClassifyVO"
>
select id,classify from book_group_classify where book_group_id = #{bookGroupId}
</select>
<!--获取群分类学习报告相关列表-->
<select
id=
"listClassifyForLearningReport"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.ClassifyLearningReportDto"
>
SELECT
...
...
@@ -845,6 +942,7 @@
order by c.id desc
</select>
<!--拖动排序-->
<update
id=
"dragSortClassify"
parameterType=
"map"
>
update book_group_classify
...
...
@@ -859,4 +957,12 @@
#{classifyId}
</foreach>
</update>
<select
id=
"pageClassify"
parameterType=
"map"
resultType=
"com.pcloud.book.group.vo.GroupStatisticVO"
>
select bgc.id classifyId, bgc.classify classifyName, bgc.price price,sum(user_number) groupPersonCount, bgc.create_time createdTime
from book_group_classify bgc left join book_group_qrcode bgq on bgc.id = bgq.classify_id
where book_group_id = #{bookGroupId}
group by bgc.id
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
3d73fa9d
...
...
@@ -335,4 +335,12 @@
select IFNULL(is_show_book_name,0) from book_group
where create_user=#{partyId} limit 1
</select>
<!--删除-->
<update
id=
"deleteByBookGroupId"
parameterType=
"map"
>
update book_group
set is_delete = 1,
update_time=now()
where id = #{bookGroupId} and is_delete = 0
</update>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
3d73fa9d
...
...
@@ -88,7 +88,8 @@
<select
id=
"listQrcodeByClassify"
resultType=
"ClassifyQrcodeVO"
parameterType=
"map"
>
SELECT
id, weixin_qrcode_id weixinQrcodeId, weixin_group_id weixinGroupId, group_name groupName, classify_id classifyId, qrcode_url qrcodeUrl, user_number userNumber, ${changeNumber} changeNumber
id, weixin_qrcode_id weixinQrcodeId, weixin_group_id weixinGroupId, group_name groupName, classify_id classifyId,
qrcode_url qrcodeUrl, user_number userNumber, ${changeNumber} changeNumber, create_time createdTime
FROM
book_group_qrcode
WHERE
...
...
@@ -500,6 +501,7 @@
</foreach>
</select>
<select
id=
"listPageRiddle"
parameterType=
"map"
resultType=
"com.pcloud.book.riddle.dto.GroupRiddleDTO"
>
SELECT
q.group_name AS groupName,
...
...
@@ -541,4 +543,10 @@
id = #{qrcodeId}
</update>
<select
id=
"getQrcodeByClassify"
parameterType=
"long"
resultType=
"com.pcloud.book.group.vo.ClassifyQrcodeVO"
>
select id, classify_id classifyId, group_name groupName, user_number userNumber, weixin_group_id weixinGroupId, create_time createdTime
from book_group_qrcode where classify_id = #{classifyId}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
View file @
3d73fa9d
...
...
@@ -69,6 +69,13 @@
update_state != 2 AND use_state in (0,1,3)
</select>
<select
id=
"getQrStatisticsByVersion"
resultType=
"QrStatisticsVO"
>
SELECT sum(if(use_state = 0, 1, 0)) notUseCount, sum(if(use_state = 1, 1, 0)) inUseCount, generation version
FROM weixin_qrcode
WHERE update_state != 2
GROUP BY generation;
</select>
<update
id=
"updateStatusToError"
>
update
weixin_qrcode
...
...
@@ -208,6 +215,12 @@
FROM weixin_qrcode
</select>
<select
id=
"getQrcodeCountByVersion"
resultType=
"QrStatisticsVO"
>
SELECT count(1) allCount, generation version
FROM weixin_qrcode
group by generation;
</select>
<select
id=
"checkExist"
resultType=
"Boolean"
parameterType=
"String"
>
select
count(1)
...
...
pcloud-service-book/src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
View file @
3d73fa9d
...
...
@@ -163,7 +163,9 @@
k.pic_url picUrl,
bk.is_warehouse as isWarehouse,
bk.warehouse_id as warehouseId,
k.reply_type replyType
k.reply_type replyType,
k.serve_id as serveId,
k.serve_type as serveType
FROM
book_keyword bk
JOIN
...
...
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClock.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClock"
>
<id
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_keyword"
property=
"clockKeyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_guide"
property=
"clockGuide"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_introduction"
property=
"clockIntroduction"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_prize_id"
property=
"clockPrizeId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_prize_url"
property=
"clockPrizeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"last_modified_user"
property=
"lastModifiedUser"
jdbcType=
"BIGINT"
/>
<result
column=
"last_modified_date"
property=
"lastModifiedDate"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"BaseResultListMapDTO"
type=
"com.pcloud.book.weixinclock.dto.WeixinClockDto"
>
<id
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_keyword"
property=
"clockKeyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_guide"
property=
"clockGuide"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_introduction"
property=
"clockIntroduction"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_prize_id"
property=
"clockPrizeId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_prize_url"
property=
"clockPrizeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"last_modified_user"
property=
"lastModifiedUser"
jdbcType=
"BIGINT"
/>
<result
column=
"last_modified_date"
property=
"lastModifiedDate"
jdbcType=
"TIMESTAMP"
/>
<association
property=
"statisticVO"
column=
"weixin_clock_id"
select=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockGroupClassifyDaoImpl.getClockGroupStatistics"
/>
</resultMap>
<resultMap
id=
"ClockBaseInfoMap"
type=
"com.pcloud.book.weixinclock.dto.WeixinClockDto"
>
<id
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_keyword"
property=
"clockKeyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_guide"
property=
"clockGuide"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_introduction"
property=
"clockIntroduction"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_prize_id"
property=
"clockPrizeId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_prize_url"
property=
"clockPrizeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"last_modified_user"
property=
"lastModifiedUser"
jdbcType=
"BIGINT"
/>
<result
column=
"last_modified_date"
property=
"lastModifiedDate"
jdbcType=
"TIMESTAMP"
/>
<association
property=
"statisticVO"
column=
"weixin_clock_id"
select=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockGroupClassifyDaoImpl.getClockGroupStatistics"
/>
<collection
property=
"weixinClockRewards"
column=
"weixin_clock_id"
select=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockRewardDaoImpl.listRewardDetail4Adviser"
/>
<collection
property=
"classifyInfoDtos"
column=
"weixin_clock_id"
select=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockGroupClassifyDaoImpl.getClassifyInfo4Update"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
weixin_clock_id, clock_keyword, clock_guide, clock_introduction, clock_prize_id, clock_prize_url, create_user, create_date,
last_modified_user, last_modified_date
</sql>
<insert
id=
"insert"
parameterType=
"weixinClock"
useGeneratedKeys=
"true"
keyProperty=
"weixinClockId"
flushCache=
"true"
>
INSERT INTO weixin_clock (
clock_keyword, clock_guide, clock_introduction, clock_prize_id, clock_prize_url, create_user, create_date,
last_modified_user, last_modified_date
)
VALUES (
#{clockKeyword, jdbcType=VARCHAR}, #{clockGuide, jdbcType=VARCHAR}, #{clockIntroduction, jdbcType=VARCHAR}, #{clockPrizeId, jdbcType=BIGINT},
#{clockPrizeUrl, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, NOW(), #{lastModifiedUser, jdbcType=BIGINT}, NOW()
)
</insert>
<!-- 获取基本信息-->
<select
id=
"getBaseInfoById"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM weixin_clock
WHERE weixin_clock_id = #{weixinClockId}
LIMIT 1
</select>
<!--修改微信群签到打卡-->
<update
id=
"update"
parameterType=
"weixinClock"
>
UPDATE weixin_clock
<set>
<if
test=
"clockKeyword != null"
>
clock_keyword = #{clockKeyword, jdbcType=VARCHAR},
</if>
<if
test=
"clockGuide != null"
>
clock_guide = #{clockGuide, jdbcType=VARCHAR},
</if>
<if
test=
"clockIntroduction != null"
>
clock_introduction = #{clockIntroduction, jdbcType=VARCHAR},
</if>
<if
test=
"clockPrizeId != null"
>
clock_prize_id = #{clockPrizeId, jdbcType=BIGINT},
</if>
<if
test=
"clockPrizeUrl != null"
>
clock_prize_url = #{clockPrizeUrl, jdbcType=VARCHAR},
</if>
<if
test=
"lastModifiedUser != null"
>
last_modified_user = #{lastModifiedUser, jdbcType=BIGINT},
</if>
last_modified_date = NOW()
</set>
WHERE weixin_clock_id = #{weixinClockId}
</update>
<!--删除微信群签到打卡-->
<delete
id=
"deleteWeixinClock"
parameterType=
"map"
>
DELETE FROM weixin_clock
WHERE weixin_clock_id = #{weixinClockId}
</delete>
<select
id=
"listWeixinClock4Adviser"
parameterType=
"map"
resultMap=
"BaseResultListMapDTO"
>
SELECT weixin_clock_id, clock_keyword, clock_guide, clock_introduction,
clock_prize_id, clock_prize_url, create_user, create_date, last_modified_user, last_modified_date
FROM
weixin_clock
WHERE create_user = #{adviserId}
<if
test=
"keyword != null"
>
and (clock_keyword like CONCAT('%', #{keyword}, '%'))
</if>
order by last_modified_date desc
</select>
<select
id=
"getWeixinClockBaseInfo"
parameterType=
"Long"
resultMap=
"ClockBaseInfoMap"
>
SELECT weixin_clock_id, clock_keyword, clock_guide, clock_introduction,
clock_prize_id, clock_prize_url, create_user, create_date, last_modified_user, last_modified_date
FROM
weixin_clock
WHERE
weixin_clock_id = #{weixinClockId}
</select>
<select
id=
"listGroupClassifyDetail4Clock"
resultType=
"com.pcloud.book.group.vo.BookGroupClassifyVO"
parameterType=
"map"
>
SELECT
c.id classifyId,
c.book_id bookId,
b.BOOK_NAME bookName,
c.classify,
c.book_group_id bookGroupId,
sum(IFNULL(g.user_number,0)) userNumber
FROM weixin_clock_group_classify wcg
INNER JOIN book_group_classify c ON wcg.book_group_classify_id = c.id
INNER JOIN book_group_qrcode g ON c.id = g.classify_id
LEFT JOIN book b ON c.book_id = b.book_id
WHERE c.is_delete = 0
AND g.is_delete = 0
AND b.is_delete = 0
AND wcg.weixin_clock_id = #{weixinClockId}
group by c.id
order by c.id desc, g.id desc
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockGroupClassify.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockGroupClassifyDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClockGroupClassify"
>
<id
column=
"weixin_clock_group_classify_id"
property=
"weixinClockGroupClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_classify_id"
property=
"bookGroupClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
</resultMap>
<resultMap
id=
"ClockBaseInfoMap"
type=
"com.pcloud.book.weixinclock.dto.WeixinClockDto"
>
<id
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_keyword"
property=
"clockKeyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_guide"
property=
"clockGuide"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_introduction"
property=
"clockIntroduction"
jdbcType=
"VARCHAR"
/>
<result
column=
"clock_prize_id"
property=
"clockPrizeId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_prize_url"
property=
"clockPrizeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_date"
property=
"createDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"last_modified_user"
property=
"lastModifiedUser"
jdbcType=
"BIGINT"
/>
<result
column=
"last_modified_date"
property=
"lastModifiedDate"
jdbcType=
"TIMESTAMP"
/>
<collection
property=
"weixinClockRewards"
column=
"weixin_clock_id"
select=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockRewardDaoImpl.listRewardDetail4Adviser"
/>
</resultMap>
<insert
id=
"batchInsert"
parameterType=
"weixinClockGroupClassify"
useGeneratedKeys=
"true"
keyProperty=
"weixinClockGroupClassifyId"
flushCache=
"true"
>
insert into weixin_clock_group_classify (
book_group_classify_id,
weixin_clock_id
) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.bookGroupClassifyId,jdbcType=BIGINT},
#{item.weixinClockId,jdbcType=INTEGER}
)
</foreach>
</insert>
<select
id=
"getKeywordByGroupClassify"
parameterType=
"map"
resultType=
"String"
>
SELECT
wc.clock_keyword
FROM
weixin_clock_group_classify wcc
LEFT JOIN weixin_clock wc ON wcc.weixin_clock_id = wc.weixin_clock_id
WHERE
wcc.book_group_classify_id = #{bookGroupClassifyId}
ORDER BY wc.create_date DESC
LIMIT 1
</select>
<select
id=
"getClockBaseInfoByClassify"
parameterType=
"map"
resultMap=
"ClockBaseInfoMap"
>
SELECT
wc.weixin_clock_id, wc.clock_keyword, wc.clock_guide, wc.clock_introduction, wc.clock_prize_id, wc.clock_prize_url, wc.create_user, wc.create_date,
wc.last_modified_user, wc.last_modified_date
FROM
weixin_clock_group_classify wcc
LEFT JOIN weixin_clock wc ON wcc.weixin_clock_id = wc.weixin_clock_id
WHERE
wcc.book_group_classify_id = #{bookGroupClassifyId}
ORDER BY wc.create_date DESC
LIMIT 1
</select>
<!--获取打卡群统计信息-->
<select
id=
"getClockGroupStatistics"
parameterType=
"Long"
resultType=
"com.pcloud.book.group.vo.StatisticVO"
>
SELECT
COUNT(DISTINCT t1.book_group_classify_id) classifyCount,
COUNT(DISTINCT t2.id) groupNumber
FROM
weixin_clock_group_classify t1
INNER JOIN book_group_qrcode t2 ON t1.book_group_classify_id = t2.classify_id
WHERE
t2.is_delete = 0
AND t1.weixin_clock_id = #{weixinClockId}
</select>
<!-- 删除书籍应用关联信息 -->
<delete
id=
"deleteById"
parameterType=
"long"
flushCache=
"true"
>
DELETE FROM
weixin_clock_group_classify
WHERE
weixin_clock_id = #{weixinClockId}
</delete>
<select
id=
"getClassifyInfo4Update"
parameterType=
"long"
resultType=
"com.pcloud.book.weixinclock.dto.ClassifyInfoDto"
>
SELECT
c.id classifyId,
c.classify classify,
count(DISTINCT g.id) groupsCount
FROM
weixin_clock_group_classify wc
LEFT JOIN book_group_classify c ON c.id = wc.book_group_classify_id
LEFT JOIN book_group_qrcode g ON c.id = g.classify_id
WHERE c.is_delete = 0
AND g.is_delete = 0
AND wc.weixin_clock_id = #{weixinClockId}
group by c.id
order by c.id desc, g.id desc
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockMemberDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClockMember"
>
<id
column=
"weixin_clock_member_id"
property=
"weixinClockMemberId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"book_group_classify_id"
property=
"bookGroupClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_group_id"
property=
"wxGroupId"
jdbcType=
"VARCHAR"
/>
<result
column=
"nickname"
property=
"nickname"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_pic"
property=
"headPic"
jdbcType=
"VARCHAR"
/>
<result
column=
"all_clock_day"
property=
"allClockDay"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
weixin_clock_member_id, weixin_clock_id, wx_user_id, book_group_classify_id, wx_group_id, nickname, head_pic, all_clock_day,
create_time
</sql>
<insert
id=
"insert"
parameterType=
"weixinClockMember"
useGeneratedKeys=
"true"
keyProperty=
"weixinClockMemberId"
flushCache=
"true"
>
INSERT INTO weixin_clock_member (
weixin_clock_id, wx_user_id, book_group_classify_id, wx_group_id, nickname, head_pic, all_clock_day,
create_time, update_time,wechat_user_id
)
VALUES (
#{weixinClockId, jdbcType=BIGINT}, #{wxUserId, jdbcType=VARCHAR}, #{bookGroupClassifyId, jdbcType=BIGINT}, #{wxGroupId, jdbcType=VARCHAR},
#{nickname, jdbcType=VARCHAR}, #{headPic, jdbcType=VARCHAR}, #{allClockDay, jdbcType=INTEGER}, NOW(), NOW(),#{wechatUserId, jdbcType=BIGINT}
)
</insert>
<select
id=
"listWeixinClockRank"
parameterType=
"map"
resultType=
"com.pcloud.book.weixinclock.dto.RankDto"
>
SELECT
w.all_clock_day clockNum, w.nickname nickname, w.head_pic headPic, (@i :=@i + 1) rankNum
FROM
weixin_clock_member w,
(SELECT @i := 0) i
WHERE
w.wx_group_id = #{wxGroupId, jdbcType=VARCHAR}
AND (w.all_clock_day
<![CDATA[ >]]>
0 or w.wx_user_id = #{wxUserId, jdbcType=VARCHAR})
ORDER BY w.all_clock_day DESC
</select>
<select
id=
"getByWxUserId"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
weixin_clock_member_id, weixin_clock_id, wx_user_id, book_group_classify_id, wx_group_id, nickname, head_pic, all_clock_day, create_time
from
weixin_clock_member
where
wx_user_id = #{userWxId}
and wx_group_id = #{wechatGroupId}
LIMIT 1
</select>
<update
id=
"updateClockDays"
parameterType=
"map"
flushCache=
"true"
>
update weixin_clock_member
set
all_clock_day = all_clock_day + 1,
wechat_user_id = #{wechatUserId, jdbcType=BIGINT},
update_time = NOW()
where
wx_user_id = #{userWxId}
and wx_group_id = #{wechatGroupId}
</update>
<select
id=
"getMyNewOrder"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select cm.rowNo from (
select wx_user_id, (@rowNum:=@rowNum+1) AS rowNo from (
select wx_user_id, @rowNum:=0 from weixin_clock_member
where wx_group_id = #{wechatGroupId}
AND (all_clock_day
<![CDATA[ >]]>
0 or wx_user_id = #{userWxId, jdbcType=VARCHAR})
order by all_clock_day desc, update_time asc
) a
) cm where cm.wx_user_id = #{userWxId}
</select>
<select
id=
"getClockWechatUserRank"
parameterType=
"map"
resultType=
"com.pcloud.book.weixinclock.dto.RankDto"
>
select cm.rankNum rankNum, cm.clockNum clockNum, cm.nickname nickname, cm.headPic headPic from (
select wx_user_id, (@rowNum:=@rowNum+1) AS rankNum, all_clock_day clockNum, nickname nickname, head_pic headPic, wechat_user_id from (
select wx_user_id, all_clock_day, nickname, head_pic, wechat_user_id, @rowNum:=0 from weixin_clock_member
where wx_group_id = #{wechatGroupId}
AND (all_clock_day
<![CDATA[ >]]>
0 or wechat_user_id = #{wechatUserId, jdbcType=VARCHAR})
order by all_clock_day desc, update_time asc
) a
) cm where cm.wechat_user_id = #{wechatUserId}
LIMIT 1
</select>
<update
id=
"updatMemberWechatUserId"
parameterType=
"map"
>
update weixin_clock_member
set wechat_user_id = #{wechatUserId,jdbcType=BIGINT},
update_time = NOW()
where wx_user_id = #{wxUserId,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockPrizeRecord.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockPrizeRecordDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClockPrizeRecord"
>
<id
column=
"weixin_clock_prize_record_id"
property=
"weixinClockPrizeRecordId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wechat_user_id"
property=
"wechatUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_prize_id"
property=
"clockPrizeId"
jdbcType=
"BIGINT"
/>
<result
column=
"prize_time"
property=
"prizeTime"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
weixin_clock_prize_record_id, wx_user_id, wechat_user_id, clock_prize_id, prize_time,
create_time, update_time
</sql>
<select
id=
"selectByWxUserIdAndAppId"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select
<include
refid=
"Base_Column_List"
/>
from weixin_clock_prize_record
where wx_user_id = #{wxUserId,jdbcType=VARCHAR}
and clock_prize_id = #{appId}
LIMIT 1
</select>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.weixinclock.entity.WeixinClockPrizeRecord"
>
insert into weixin_clock_prize_record (wx_user_id,wechat_user_id, clock_prize_id, prize_time,
create_time, update_time)
values ( #{wxUserId,jdbcType=VARCHAR},#{wechatUserId,jdbcType=BIGINT}, #{clockPrizeId,jdbcType=BIGINT}, #{prizeTime,jdbcType=INTEGER},
NOW(), NOW())
</insert>
<update
id=
"updatePrizeTime"
parameterType=
"map"
>
update weixin_clock_prize_record
set prize_time = prize_time + #{prizeTime,jdbcType=INTEGER},
update_time = NOW()
where wx_user_id = #{wxUserId,jdbcType=VARCHAR}
and clock_prize_id = #{appId}
</update>
<select
id=
"getAllPrizeList"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from weixin_clock_prize_record
where wx_user_id = #{wxUserId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByWxUserId"
parameterType=
"map"
>
delete from weixin_clock_prize_record
where wx_user_id = #{wxUserId,jdbcType=VARCHAR}
</delete>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockReward.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockRewardDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClockReward"
>
<id
column=
"weixin_clock_reward_id"
property=
"weixinClockRewardId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"clock_days"
property=
"clockDays"
jdbcType=
"INTEGER"
/>
<result
column=
"reward_num"
property=
"rewardNum"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<insert
id=
"batchInsert"
parameterType=
"weixinClockReward"
useGeneratedKeys=
"true"
keyProperty=
"weixinClockRewardId"
flushCache=
"true"
>
insert into weixin_clock_reward (
weixin_clock_id,
clock_days,
reward_num,
create_time
) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.weixinClockId,jdbcType=BIGINT},
#{item.clockDays,jdbcType=INTEGER},
#{item.rewardNum,jdbcType=INTEGER},
NOW()
)
</foreach>
</insert>
<select
id=
"listRewardDetail4Adviser"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
SELECT clock_days,reward_num
FROM weixin_clock_reward
WHERE weixin_clock_id = #{weixinClockId}
ORDER BY clock_days asc
</select>
<!-- 删除书籍应用关联信息 -->
<delete
id=
"deleteById"
parameterType=
"long"
flushCache=
"true"
>
DELETE FROM
weixin_clock_reward
WHERE
weixin_clock_id = #{weixinClockId}
</delete>
<select
id=
"getGrantNumFromReward"
parameterType=
"map"
resultType=
"Integer"
>
select reward_num
from weixin_clock_reward
WHERE weixin_clock_id = #{weixinClockId}
AND clock_days = #{clockDays}
LIMIT 1
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockTopic.Mapper.xml
0 → 100644
View file @
3d73fa9d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.weixinclock.dao.impl.WeixinClockTopicDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.weixinclock.entity.WeixinClockTopic"
>
<id
column=
"weixin_clock_topic_id"
property=
"weixinClockTopicId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_member_id"
property=
"weixinClockMemberId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"book_group_classify_id"
property=
"bookGroupClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_group_id"
property=
"wxGroupId"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_day"
property=
"createdDay"
jdbcType=
"DATE"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
weixin_clock_topic_id, weixin_clock_id, weixin_clock_member_id, wx_user_id, book_group_classify_id, wx_group_id, created_day, create_time
</sql>
<insert
id=
"insert"
parameterType=
"weixinClockTopic"
useGeneratedKeys=
"true"
keyProperty=
"weixinClockTopicId"
flushCache=
"true"
>
INSERT INTO weixin_clock_topic (
weixin_clock_id, weixin_clock_member_id, wx_user_id, book_group_classify_id, wx_group_id, created_day, create_time
)
VALUES (
#{weixinClockId, jdbcType=BIGINT}, #{weixinClockMemberId, jdbcType=BIGINT}, #{wxUserId, jdbcType=VARCHAR}, #{bookGroupClassifyId, jdbcType=BIGINT},
#{wxGroupId, jdbcType=VARCHAR}, #{createdDay, jdbcType=DATE}, NOW()
)
</insert>
<!-- 获取用户今天打卡情况 -->
<select
id=
"getTopicByIds4Today"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select
<include
refid=
"Base_Column_List"
/>
from weixin_clock_topic
where
wx_group_id = #{wxGroupId, jdbcType=VARCHAR}
and wx_user_id = #{wxUserId, jdbcType=VARCHAR}
AND CREATED_DAY = #{date}
LIMIT 1
</select>
<!-- 获得该用户的打卡天数 -->
<select
id=
"getClockCountByUser"
parameterType=
"map"
resultType=
"long"
>
SELECT
count(DISTINCT CREATED_DAY)
FROM
weixin_clock_topic
WHERE
wx_group_id = #{wxGroupId, jdbcType=VARCHAR}
AND wx_user_id = #{wxUserId, jdbcType=VARCHAR}
<if
test=
"createdDay != null"
>
AND CREATED_DAY = #{createdDay,jdbcType=VARCHAR}
</if>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/template/template_bookGroupStatistics.ftl
0 → 100644
View file @
3d73fa9d
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook
xmlns=
"urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o=
"urn:schemas-microsoft-com:office:office"
xmlns:x=
"urn:schemas-microsoft-com:office:excel"
xmlns:dt=
"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ss=
"urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html=
"http://www.w3.org/TR/REC-html40"
>
<DocumentProperties
xmlns=
"urn:schemas-microsoft-com:office:office"
>
<Author>
蒙娇
</Author>
<LastAuthor>
林伟彬
</LastAuthor>
<Created>
2017-06-27T08:48:00Z
</Created>
<LastSaved>
2017-07-16T07:06:45Z
</LastSaved>
<Version>
15.00
</Version>
</DocumentProperties>
<CustomDocumentProperties
xmlns=
"urn:schemas-microsoft-com:office:office"
>
<KSOProductBuildVer
dt:dt=
"string"
>
2052-10.1.0.6489
</KSOProductBuildVer>
</CustomDocumentProperties>
<OfficeDocumentSettings
xmlns=
"urn:schemas-microsoft-com:office:office"
>
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook
xmlns=
"urn:schemas-microsoft-com:office:excel"
>
<WindowHeight>
11388
</WindowHeight>
<WindowWidth>
22944
</WindowWidth>
<WindowTopX>
0
</WindowTopX>
<WindowTopY>
0
</WindowTopY>
<ProtectStructure>
False
</ProtectStructure>
<ProtectWindows>
False
</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style
ss:ID=
"Default"
ss:Name=
"Normal"
>
<Alignment
ss:Vertical=
"Center"
/>
<Borders/>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style
ss:ID=
"m2113688147332"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"14"
ss:Color=
"#000000"
ss:Bold=
"1"
/>
</Style>
<Style
ss:ID=
"m2113688147372"
>
<Alignment
ss:Horizontal=
"Left"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
/>
</Style>
<Style
ss:ID=
"m2113688147392"
>
<Alignment
ss:Horizontal=
"Left"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
/>
</Style>
<Style
ss:ID=
"s94"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<Interior
ss:Color=
"#AEAAAA"
ss:Pattern=
"Solid"
/>
</Style>
<Style
ss:ID=
"s95"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
</Style>
<Style
ss:ID=
"s96"
>
<Alignment
ss:Horizontal=
"Right"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
</Style>
<Style
ss:ID=
"s97"
>
<Alignment
ss:Horizontal=
"Right"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<NumberFormat
ss:Format=
"0%"
/>
</Style>
<Style
ss:ID=
"s99"
>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
</Style>
<Style
ss:ID=
"s100"
>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<NumberFormat
ss:Format=
"0%"
/>
</Style>
<Style
ss:ID=
"s120"
>
<Alignment
ss:Horizontal=
"Left"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
ss:Bold=
"1"
/>
</Style>
<Style
ss:ID=
"s121"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<Interior
ss:Color=
"#AEAAAA"
ss:Pattern=
"Solid"
/>
</Style>
<Style
ss:ID=
"s122"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
</Style>
<Style
ss:ID=
"s123"
>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
</Style>
<Style
ss:ID=
"s124"
>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
<Border
ss:Position=
"Top"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<NumberFormat
ss:Format=
"0%"
/>
</Style>
<Style
ss:ID=
"s126"
>
<Alignment
ss:Horizontal=
"Left"
ss:Vertical=
"Center"
/>
<Borders>
<Border
ss:Position=
"Bottom"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
<Border
ss:Position=
"Right"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
ss:Color=
"#000000"
/>
</Borders>
<Font
ss:FontName=
"宋体"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
ss:Bold=
"1"
/>
</Style>
</Styles>
<Worksheet
ss:Name=
"Sheet1"
>
<Table
ss:ExpandedColumnCount=
"7"
ss:ExpandedRowCount=
"10000"
x:FullColumns=
"1"
x:FullRows=
"1"
ss:DefaultColumnWidth=
"48.6"
ss:DefaultRowHeight=
"19.950000000000003"
>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"169.20000000000002"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"63.599999999999994"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"64.8"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"99.6"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"76.8"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"63.599999999999994"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"59.4"
/>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"26.4"
>
<Cell
ss:MergeAcross=
"6"
ss:MergeDown=
"1"
ss:StyleID=
"m2113688147332"
><Data
ss:Type=
"String"
>
${title!}
</Data></Cell>
</Row>
<Row
ss:AutoFitHeight=
"0"
/>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:MergeAcross=
"6"
ss:StyleID=
"s126"
><Data
ss:Type=
"String"
>
应用统计 销售总额:¥${appSumStatistics.saleMoney!} 收益总额:¥${appSumStatistics.income!} 浏览总量:${appSumStatistics.scanCounts!}
</Data></Cell>
</Row>
<
#if appIncomeList??>
<
#list appIncomeList as app>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:MergeAcross=
"6"
ss:StyleID=
"m2113688147372"
><Data
ss:Type=
"String"
>
应用名称:${app.appName!} 销售额:¥${app.saleMoney!} 收益额:¥${app.income!} 浏览量:${app.scanCounts!}
</Data></Cell>
</Row>
<
#if app.itemList??>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:StyleID=
"s94"
><Data
ss:Type=
"String"
>
商品名称
</Data></Cell>
<Cell
ss:StyleID=
"s94"
><Data
ss:Type=
"String"
>
浏览量
</Data></Cell>
<Cell
ss:StyleID=
"s94"
><Data
ss:Type=
"String"
>
销售量
</Data></Cell>
<Cell
ss:StyleID=
"s94"
><Data
ss:Type=
"String"
>
销售总额(¥)
</Data></Cell>
<Cell
ss:StyleID=
"s94"
><Data
ss:Type=
"String"
>
收益额(¥)
</Data></Cell>
</Row>
<
#list app.itemList as appProduct>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:StyleID=
"s95"
><Data
ss:Type=
"String"
>
${appProduct.productName!}
</Data></Cell>
<Cell
ss:StyleID=
"s96"
><Data
ss:Type=
"Number"
>
${appProduct.scanCounts!}
</Data></Cell>
<Cell
ss:StyleID=
"s96"
><Data
ss:Type=
"Number"
>
${appProduct.saleCounts!}
</Data></Cell>
<Cell
ss:StyleID=
"s96"
><Data
ss:Type=
"Number"
>
${appProduct.saleMoney!}
</Data></Cell>
<Cell
ss:StyleID=
"s96"
><Data
ss:Type=
"Number"
>
${appProduct.income!}
</Data></Cell>
</Row>
<
/#list>
<
/#if>
<
/#list>
<
/#if>
<Row
ss:AutoFitHeight=
"0"
/>
<Row
ss:AutoFitHeight=
"0"
/>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:MergeAcross=
"6"
ss:StyleID=
"s120"
><Data
ss:Type=
"String"
>
商品统计 销售总额:¥${productSumStatistics.saleMoney!} 收益总额:¥${productSumStatistics.income!} 浏览总量:${productSumStatistics.scanCounts!}
</Data></Cell>
</Row>
<
#if productIncomeList??>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:StyleID=
"s121"
><Data
ss:Type=
"String"
>
商品名称
</Data></Cell>
<Cell
ss:StyleID=
"s121"
><Data
ss:Type=
"String"
>
浏览量
</Data></Cell>
<Cell
ss:StyleID=
"s121"
><Data
ss:Type=
"String"
>
销售量
</Data></Cell>
<Cell
ss:StyleID=
"s121"
><Data
ss:Type=
"String"
>
销售总额(¥)
</Data></Cell>
<Cell
ss:StyleID=
"s121"
><Data
ss:Type=
"String"
>
收益额(¥)
</Data></Cell>
</Row>
<
#list productIncomeList as product>
<Row
ss:AutoFitHeight=
"0"
>
<Cell
ss:StyleID=
"s122"
><Data
ss:Type=
"String"
>
${product.productName!}
</Data></Cell>
<Cell
ss:StyleID=
"s123"
><Data
ss:Type=
"Number"
>
${product.scanCounts!}
</Data></Cell>
<Cell
ss:StyleID=
"s123"
><Data
ss:Type=
"Number"
>
${product.saleCounts!}
</Data></Cell>
<Cell
ss:StyleID=
"s123"
><Data
ss:Type=
"Number"
>
${product.saleMoney!}
</Data></Cell>
<Cell
ss:StyleID=
"s123"
><Data
ss:Type=
"Number"
>
${product.income!}
</Data></Cell>
</Row>
<
/#list>
<
/#if>
</Table>
<WorksheetOptions
xmlns=
"urn:schemas-microsoft-com:office:excel"
>
<PageSetup>
<Header
x:Margin=
"0.3"
/>
<Footer
x:Margin=
"0.3"
/>
<PageMargins
x:Bottom=
"0.75"
x:Left=
"0.69930555555555596"
x:Right=
"0.69930555555555596"
x:Top=
"0.75"
/>
</PageSetup>
<Unsynced/>
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>
9
</PaperSizeIndex>
<HorizontalResolution>
600
</HorizontalResolution>
<VerticalResolution>
600
</VerticalResolution>
</Print>
<Selected/>
<Panes>
<Pane>
<Number>
3
</Number>
<ActiveRow>
12
</ActiveRow>
<ActiveCol>
16
</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>
False
</ProtectObjects>
<ProtectScenarios>
False
</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
pom.xml
View file @
3d73fa9d
...
...
@@ -105,21 +105,19 @@
<pcloud-common-web.version>
2.1.0-RELEASE
</pcloud-common-web.version>
<!-- book -->
<pcloud-facade-book.version>
2.1.0-RELEASE
</pcloud-facade-book.version>
<pcloud-service-book.version>
2.1.0-RELEASE
</pcloud-service-book.version>
<pcloud-facade-usercenter.version>
2.1.0-RELEASE
</pcloud-facade-usercenter.version>
<pcloud-facade-channelcenter.version>
2.1.0-RELEASE
</pcloud-facade-channelcenter.version>
<pcloud-facade-resourcecenter.version>
2.1.0-RELEASE
</pcloud-facade-resourcecenter.version>
<pcloud-facade-analysisengine.version>
2.1.0-RELEASE
</pcloud-facade-analysisengine.version>
<pcloud-facade-quartz.version>
2.1.0-RELEASE
</pcloud-facade-quartz.version>
<pcloud-facade-appcenter.version>
2.1.0-RELEASE
</pcloud-facade-appcenter.version>
<pcloud-facade-settlement.version>
2.1.0-RELEASE
</pcloud-facade-settlement.version>
<pcloud-facade-settlement.version>
2.1.0-RELEASE
</pcloud-facade-settlement.version>
<pcloud-facade-message.version>
2.1.0-RELEASE
</pcloud-facade-message.version>
<pcloud-facade-commoncenter.version>
2.1.0-RELEASE
</pcloud-facade-commoncenter.version>
<pcloud-facade-comment.version>
2.1.0-RELEASE
</pcloud-facade-comment.version>
<pcloud-facade-voicemessage.version>
2.1.0-RELEASE
</pcloud-facade-voicemessage.version>
<pcloud-facade-raystask.version>
2.1.0-RELEASE
</pcloud-facade-raystask.version>
<pcloud-facade-contentcenter.version>
2.1.0-
SNAPSHOT
</pcloud-facade-contentcenter.version>
<pcloud-facade-contentcenter.version>
2.1.0-
RELEASE
</pcloud-facade-contentcenter.version>
<pcloud-facade-tradecenter.version>
2.1.0-RELEASE
</pcloud-facade-tradecenter.version>
<pcloud-facade-readercenter.version>
2.1.0-RELEASE
</pcloud-facade-readercenter.version>
<pcloud-facade-labelcenter.version>
2.1.0-RELEASE
</pcloud-facade-labelcenter.version>
...
...
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